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

Error: Cannot find module 'eslint-plugin-react' #949

Closed
MarkTiedemann opened this issue Jul 11, 2017 · 8 comments

Comments

@MarkTiedemann
Copy link

commented Jul 11, 2017

Using npm@5.2.0 and standard@10.0.2 together does not seem to work as an npm script. It works if I run it directly from the command line (on Windows).

λ ll

node_modules
package-lock.json
package.json

λ type package.json

{
  "name": "standard-npm-bug",
  "version": "0.1.0",
  "scripts": {
    "test": "standard"
  },
  "devDependencies": {
    "standard": "^10.0.2"
  }
}

λ npm t

> standard-npm-bug@0.1.0 test C:\dev\node\standard-npm-bug
> standard

standard: Unexpected linter output:

Error: Failed to load plugin react: Cannot find module 'eslint-plugin-react'
Referenced from: C:\dev\node\standard-npm-bug\node_modules\standard\eslintrc.json
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.resolve (internal/module.js:18:19)
    at Object.load (C:\dev\node\standard-npm-bug\node_modules\eslint\lib\config\plugins.js:134:29)
    at Array.forEach (native)
    at Object.loadAll (C:\dev\node\standard-npm-bug\node_modules\eslint\lib\config\plugins.js:162:21)
    at load (C:\dev\node\standard-npm-bug\node_modules\eslint\lib\config\config-file.js:541:21)
    at configExtends.reduceRight (C:\dev\node\standard-npm-bug\node_modules\eslint\lib\config\config-file.js:424:36)
    at Array.reduceRight (native)
    at applyExtends (C:\dev\node\standard-npm-bug\node_modules\eslint\lib\config\config-file.js:408:28)
    at Object.load (C:\dev\node\standard-npm-bug\node_modules\eslint\lib\config\config-file.js:566:22)

If you think this is a bug in `standard`, open an issue: https://github.com/feross/standard/issues
npm ERR! Test failed.  See above for more details.

λ npm -v

5.2.0

λ node -v

v8.1.2

λ ver

Microsoft Windows [Version 10.0.15063]
@big-kahuna-burger

This comment has been minimized.

Copy link

commented Jul 12, 2017

Same here:

> authentic-ui@1.1.0 test /home/travis/build/big-kahuna-burger/authentic-ui
> node test/index.js && standard && npm run deps
standard: Unexpected linter output:
Error: Failed to load plugin import: Cannot find module 'eslint-plugin-import'
Referenced from: /home/travis/build/big-kahuna-burger/authentic-ui/node_modules/standard/eslintrc.json...

Operating System Details
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04

@klaemo

This comment has been minimized.

Copy link

commented Jul 12, 2017

I'm encountering the same problem. Not sure if it's related to standard though, because it only started happening with the latest npm version(s).
The packages all seem to be there, too:
bildschirmfoto 2017-07-12 um 11 15 12

@lovell

This comment has been minimized.

Copy link

commented Jul 12, 2017

This was a breaking change in npm v5.2.0 that has now been reverted. Use npm v5.1.0 as a workaround until v5.2.1 is available.

@MarkTiedemann

This comment has been minimized.

Copy link
Author

commented Jul 12, 2017

npm i -g npm@5.1.0 && rm -rf node_modules && npm i && npm t worked. Thanks for the help!

@big-kahuna-burger

This comment has been minimized.

Copy link

commented Jul 12, 2017

@lovell cheers for figuring out. Appreciated.

@tensor5

This comment has been minimized.

Copy link

commented Jul 14, 2017

I have the same issue with npm v5.3.0.

@needim

This comment has been minimized.

Copy link

commented Jul 27, 2017

I updated eslint to 4.3.0 and it worked. fyi.

@AndrejGajdos

This comment has been minimized.

Copy link

commented Aug 8, 2017

@tensor5 me too

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
7 participants
You can’t perform that action at this time.