Cannot find module 'babel-eslint' (both standard and babel-eslint already installed locally)
Asked Answered
B

3

7

What version of standard?

12.0.1

What operating system, Node.js, and npm version?

Windows 10, Node v10.15.1, NPM v.6.8.0

What did you expect to happen?

  • I install both standard and babel-eslint on devDependencies (locally).
  • I run standard --parser babel-eslint
  • I get the standard use babel-eslint parser to recognize babel code style and not stating it as style error

What actually happened?

  • I install both standard and babel-eslint on devDependencies (locally).

  • I run standard --parser babel-eslint

  • I get error: Cannot find module 'babel-eslint'

I read from previous issues 85 1167, it should be fixed when they are installed on the same level. But it does not happen on mine.

I have tried to put config below on package.json:

"standard": {
    "parser": "babel-eslint"
  }

But it does not resolve the issue.

Bloodred answered 15/3, 2019 at 10:23 Comment(1)
Already solved here on the github issues github.com/standard/standard/issues/1257Bloodred
K
10

Hi this is an old question but for who passes here in the future, those answers didn't work for me, but this one did:

npm install babel-eslint --save-dev
Kherson answered 3/10, 2021 at 7:15 Comment(1)
babel-eslint is deprecated now: npmjs.com/package/babel-eslintDoublecheck
E
4

Try

$yarn add standard babel-eslint
Eurus answered 29/8, 2019 at 5:29 Comment(0)
U
1

I solved this by doing:

npm install -g babel-eslint
Uel answered 25/9, 2019 at 18:31 Comment(1)
I can't think of any good reason why this should be installed globally...Softhearted

© 2022 - 2024 — McMap. All rights reserved.