Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eslint error from vue Error: Cannot find module 'eslint/lib/ast-utils'

Tags:

eslint

vue.js

I'm trying to run eslint on my code but am getting the following error:

> vue-cli-service lint; vue-cli-service test

 ERROR  Error: Cannot find module 'eslint/lib/ast-utils'
Referenced from: /Users/username/Development/project/tests/e2e/.eslintrc
Error: Cannot find module 'eslint/lib/ast-utils'
Referenced from: /Users/username/Development/project/tests/e2e/.eslintrc
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/username/Development/project/node_modules/eslint-plugin-protractor/lib/rules/array-callback-return.js:8:16)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

Versions:

"@babel/core": "^7.1.0",
"@babel/plugin-syntax-flow": "^7.0.0",
"@babel/preset-flow": "^7.0.0",
"@babel/plugin-transform-flow-strip-types": "^7.0.0",
"@vue/cli-plugin-babel": "^3.0.5",
"@vue/cli-plugin-eslint": "^3.0.5",
"@vue/cli-plugin-unit-jest": "^3.0.5",
"@vue/cli-service": "^3.0.5",
"@vue/test-utils": "^1.0.0-beta.25",
"babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.2",
"eslint": "^5.6.1",
"eslint-config-sagely": "git+ssh://[email protected]/sagely/eslint-config-sagely.git",
"eslint-plugin-flowtype": "^2.50.3",
"eslint-plugin-flowtype-errors": "^3.6.0",
"eslint-plugin-vue": "^4.7.1",

What am I missing here?

like image 455
Justin808 Avatar asked Oct 12 '18 19:10

Justin808


1 Answers

In my case I got a similar Error: Cannot find module 'eslint/lib/rules/utils/ast-utils' and I needed to upgrade eslint - v5 to v7 worked for me.

like image 151
pzrq Avatar answered Oct 13 '22 12:10

pzrq