Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension not working: Cannot find module 'acorn' #858

Closed
alexeychikk opened this issue Jun 23, 2019 · 9 comments
Closed

Extension not working: Cannot find module 'acorn' #858

alexeychikk opened this issue Jun 23, 2019 · 9 comments
Labels
locked Please open a new issue and fill out the template instead of commenting.

Comments

@alexeychikk
Copy link

Extension is not working currently and outputs the following error Cannot find module 'acorn'.
Reinstalling didn't help.
It helped when I manually installed acorn package in the project's folder even though my project doesn't depend on it.

@himanshupnt
Copy link

himanshupnt commented Jun 23, 2019

I'm also facing similar issue. Any plugin in plugins errors out Cannot find module <module name>
.eslintrc ->

{
  "parser": "babel-eslint",
  "parserOptions": {
      "sourceType": "module"
  },
  "env": {
    "browser": true,
    "node": true,
    "jest": true,
    "es6": true
  },
  "plugins": [
    "prettier",
    "react",
    "jest"
  ],
  "extends": [
    "eslint:recommended",
    "plugin:react/recommended"
  ],
  "settings": {
    "react": {
      "createClass": "createReactClass",
      "pragma": "React",
      "version": "detect"
    }
  },
  "rules": {
    "react/destructuring-assignment": [2, "always", { "ignoreClassFields": true }],
    "react/no-array-index-key": 2,
    "react/no-unused-state": 2,
    "react/no-unused-prop-types": 2,
    "prettier/prettier": "error",
    "no-nested-ternary": 2,
    "semi": [2, "always"],
    "prefer-destructuring": ["error", {"object": true, "array": true}],
    "prefer-const": ["error", {
      "destructuring": "any"
    }],
    "indent": ["error", 2, { "SwitchCase": 1 }],
    "max-len": ["error", { "code": 120 }]
  }
}

package.json ->

"eslint": "^6.0.0",
    "eslint-config-prettier": "^5.0.0",
    "eslint-plugin-import": "^2.17.3",
    "eslint-plugin-jest": "^22.7.1",
    "eslint-plugin-jsx-a11y": "^6.2.1",
    "eslint-plugin-prettier": "^3.1.0",
    "eslint-plugin-react": "^7.13.0",
    "prettier": "^1.18.2",

@AlaaZorkane
Copy link

Same issue here.
VS code throws me an error each time I try to format:
image
This is only within vscode itself, the cli tool works perfectly using "prettier --write /somefile.js"

Some additional info:
eslint debug shows no errors - eslint is working as intended
Any plugin/extends throw the same error not only eslint-plugin-prettier
Tried installing/uninstalling globally, same issue eveytime.

@cannap
Copy link

cannap commented Jun 27, 2019

i donwgraded eslint to ^4.0.0 until a fix

@EthanNYT
Copy link

I downgraded eslint to ^4.0.0

Works for me as well:

  • ESLint: v4.0.0
  • Node: v10.14.2
  • VS Code: 1.35.1

@devias-io
Copy link

Try to remove everything from settings.json. It should fix the problem.

@cannap
Copy link

cannap commented Jul 24, 2019

i dont have any prettier related stuff in settings.json

this is my workspace settings.json file

{
"search.exclude": {
"/.nuxt": true
},
"files.watcherExclude": {
"
/.nuxt": true
},
"files.exclude": {
"**/.nuxt": true
},
"vue-i18n-ally.localesPaths": "lang"
}

@samarti
Copy link

samarti commented Jul 26, 2019

What I did was to remove any reference to esLint on settings.json
I removed:

{
  "prettier.eslintIntegration": true,
  "eslint.enable": true,
}

and it worked fine

@ntotten
Copy link
Member

ntotten commented Aug 12, 2019

Duplicate of #870

@ntotten ntotten marked this as a duplicate of #870 Aug 12, 2019
@ntotten ntotten closed this as completed Aug 12, 2019
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the locked Please open a new issue and fill out the template instead of commenting. label Apr 12, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests

7 participants