Although I am not well-versed in front-end development, I am attempting to lint my JavaScript/Vue.js file within a Rails 5.1 application. Since I am not very familiar with the node ecosystem, I encountered the following error and am seeking guidance on how to address it:
Tue Apr 17$ eslint javascript/ --ext .vue
Cannot find module 'eslint-plugin-vue'
Referenced from: /Users/jt/repos/embers2/.eslintrc.js
Error: Cannot find module 'eslint-plugin-vue'
Referenced from: /Users/jt/repos/embers2/.eslintrc.js
at ModuleResolver.resolve (/usr/local/lib/node_modules/eslint-config-airbnb-standard/node_modules/eslint/lib/util/module-resolver.js:74:19)
at resolve (/usr/local/lib/node_modules/eslint-config-airbnb-standard/node_modules/eslint/lib/config/config-file.js:466:29)
at load (/usr/local/lib/node_modules/eslint-config-airbnb-standard/node_modules/eslint/lib/config/config-file.js:542:26)
at configExtends.reduceRight (/usr/local/lib/node_modules/eslint-config-airbnb-standard/node_modules/eslint/lib/config/config-file.js:421:36)
at Array.reduceRight (<anonymous>)
at applyExtends (/usr/local/lib/node_modules/eslint-config-airbnb-standard/node_modules/eslint/lib/config/config-file.js:403:28)
at loadFromDisk (/usr/local/lib/node_modules/eslint-config-airbnb-standard/node_modules/eslint/lib/config/config-file.js:514:22)
at Object.load (/usr/local/lib/node_modules/eslint-config-airbnb-standard/node_modules/eslint/lib/config/config-file.js:550:20)
at Config.getLocalConfigHierarchy (/usr/local/lib/node_modules/eslint-config-airbnb-standard/node_modules/eslint/lib/config.js:228:44)
at Config.getConfigHierarchy (/usr/local/lib/node_modules/eslint-config-airbnb-standard/node_modules/eslint/lib/config.js:180:43)
Tue Apr 17$
This is the content of my .eslint.js file:
module.exports = {
extends: [
// add more generic rulesets here, such as:
// 'eslint:recommended',
'plugin:vue/essential',
'airbnb-base'
],
rules: {
// override/add rules settings here, such as:
// 'vue/no-unused-vars': 'error'
}
};
Furthermore, my package.json file includes the following dependencies:
{
"dependencies": {
// list of dependencies
},
"devDependencies": {
// list of dev dependencies
}
}
I am unsure where to begin troubleshooting this issue within the node ecosystem, as it still appears complex to me. If anyone has suggestions on how to approach this problem, I would greatly appreciate it.
Upon a suggestion from a comment, I ran npm install
and confirmed that the plugin seems to be located in ./node_modules/
:
https://i.sstatic.net/lheA3.png
However, I am still encountering the same error. Any other insights or recommendations to resolve this?