let jshint2_command = '~/path/to/node_modules/.bin/jshint'
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')
某草草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/你的名字