7

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?

1

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

Comments

0

The easiest way to resolve this would be removing your node_modules folder and do npm install again or install all packages again using whatever package manager you use.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.