Home  >  Q&A  >  body text

vimrc - vim cannot be used after installing the jshint plug-in. The ~ symbol appears when setting the plug-in running path. I use the win system, how can I change it?

The following is the set path. The path starts with a ~ symbol, but I am using win10. How should I modify this path so that it can also be used on win systems?

let jshint2_command = '~/path/to/node_modules/.bin/jshint'

The following is a screenshot of the error message

天蓬老师天蓬老师2735 days ago772

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-05-16 16:36:24

    Is this really the real path of jshint? I don’t know much about it, but if the path is not wrong, try it expand('~/path/to/node_modules/.bin/jshint')

    reply
    0
  • 某草草

    某草草2017-05-16 16:36:24

    This is the path where JSHint cannot be found. ~/path/to/node_modules 翻译过来就是 ~/路径/到/node_modules ,意思是你要自己把这个路径修改成正确的路径。。。
    先找到你 npm -g install The installation path.

    This command to see if you have modified npm’s prefix configuration:

    npm config list | grep ^prefix

    If there is no output in this step, then you probably have not modified the configuration and are using the default path. You can see the default path with this command:

    npm config list -l | grep ^prefix

    prefix = "xxxxx" 这个 xxxxx 就是安装路径了。印象中默认是 AppDataRoamingnpm,你自己检查确认下。在里面如果有 jshint 文件夹,你就把 AppDataRoamingnpmjshint.binjshint 这个路径在 vimrc 中赋给 jshint_command.

    If you have npm folder but not jshint, then first npm i -g jshint


    By the way, ~ 是 linux 和 unix 系统默认的 User(用户)文件夹,相当于 Windows 的 Users/User/你的名字

    reply
    0
  • Cancelreply