sublime eslint報錯找不到模組eslint
npm i eslint -g npm install babel-eslint -g和npm i eslint 到本地都安裝成功了 仍然報錯.
module.js:327
throw err;
^
Error: Cannot find module ‘eslint’
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (C:\Users\MyUser\AppData\Roaming\Sublime Text 3\Packages\ESLint\linter.js:12:17)
at Module._compile (module.js:409:26)
at Object.Module._extensions…js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
[Finished in 0.2s with exit code 1]
解決方法:
修改SublimePreferences。 "Preferences / Package Settings / ESLint / Settings - User"配置node_path,node_modules_path。
{
“node_path”: “/usr/local/bin”,
“node_modules_path”: “/usr/local/lib/node_modules”
}
報錯修復。