You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't tried yet. I think that would be a wild goose chase. This problem just started today out of the blue. My hunch is that is an environment problem of some sort.
Which terms did you search for in User Guide?
I did a google search instead. Found no help.
Environment
node -v: v8.1.2
npm -v: 5.2.0
yarn --version (if you use Yarn): don't use
npm ls react-scripts (if you haven’t ejected): react-scripts@1.0.10
Then, specify:
Operating system: macOS 10.12.5
Browser and version (if relevant): Chrome Version 59.0.3071.115 (Official Build) (64-bit)
Failed to compile.
./src/index.js
Module build failed: Error: Failed to load plugin import: Cannot find module 'eslint-plugin-import'
Referenced from:
at Array.forEach (native)
at Array.reduceRight (native)
Expected Behavior
(Write what you thought would happen.)
Actual Behavior
(Write what happened. Please add screenshots!)
Reproducible Demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
Reacted by Askar Karasawa, tjckso, Nathan, David Konsumer, Alexander Kachkaev, Maria Katsourani, Hugh Rawlinson, Gilles Castel, Mark Edington, lex and 6 more
Can confirm I'm seeing this too with a fresh create-react-app setup. Doesn't seem to be a problem when I use yarn, however. I'm at yarn@0.27.5, node@v6.11.0 and npm@5.2.0.
@tenzan thanks for the full list of plugins that npm 5.2 finds missing. One thing to bear in mind is that eslint-plugin-jsx-a11y should be v5 instead of the latest (v6); otherwise each file creates a warning:
npm start
Compiled with warnings.
./src/index.js
Line 1: Definition for rule 'jsx-a11y/href-no-hash' was not found jsx-a11y/href-no-hash
./src/registerServiceWorker.js
Line 11: Definition for rule 'jsx-a11y/href-no-hash' was not found jsx-a11y/href-no-hash
./src/App.js
Line 1: Definition for rule 'jsx-a11y/href-no-hash' was not found jsx-a11y/href-no-hash
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
Here's a one-liner hack that temporary helped me npm start without downgrading npm to v4:
Here's a one-liner hack that temporary helped me npm start without downgrading npm to v4
May I ask why you're against downgrading to npm v4?
npm@5 was a rushed release so that it could be included with Node 8; I would not expect it to be stable for some time.
In the interim, I'd continue to use npm@4 or Yarn if you're concerned about having a Lockfile.
Please file bugs with npm too so they can fix.
I'm not sure what the npm cli team is really doing -- for example, 5.2.0 was released which contained this issue's bug; they reverted the commit but have not made a patch release, leaving people to suffer with this problem for days.
I would not expect the npm cli team to be pressed by any authority until Node 8 is about to enter LTS.
I can empathize with npm here because the only way they can find bugs after a rewrite is by pushing out releases and fixing regressions. I’m hopeful that it should get better after 5.2.1.
I'd like to stress that I'm very grateful for the effort the npm team puts in.
I do not want to undermine what they're doing in any way; I just wish they'd push bug fixes on a slightly quicker-schedule since so many people are already treating it as stable.
Activity
deehuey commentedon Jul 13, 2017
npm install eslint-plugin-importis a temporary fix while you await a proper fix!tenzan commentedon Jul 13, 2017
I had same issue.
Installing manually following modules was a fix for me:
rdmurphy commentedon Jul 13, 2017
Can confirm I'm seeing this too with a fresh
create-react-appsetup. Doesn't seem to be a problem when I useyarn, however. I'm atyarn@0.27.5,node@v6.11.0andnpm@5.2.0.Timer commentedon Jul 13, 2017
The following is working fine:
$ npx create-react-app test-eslint $ cd test-eslint/ $ yarn startThis means it's an NPM bug or an environment bug.
Either way, you should try NPM 4 like suggested as NPM 5 is very buggy.
If you can tell us how or why your environment is unique, we may be able to help. But this is not a bug on our end.
tjkSec commentedon Jul 13, 2017
Switching back to npm@4.6.1 solved the issue for me.
Timer commentedon Jul 13, 2017
Thanks for confirming @tjkSec; closing this as author failed to follow the issue template.
For anyone experiencing this issue; please use NPM 4.x (
npm install -g npm@4).nathan-charrois commentedon Jul 13, 2017
Users on reddit reporting the same issue. Agree it's a problem with NPM.
Timer commentedon Jul 13, 2017
I've commented on reddit, @NathanCH. Thanks for the heads up.
gaearon commentedon Jul 13, 2017
Please file bugs with npm too so they can fix.
kachkaev commentedon Jul 13, 2017
@tenzan thanks for the full list of plugins that npm 5.2 finds missing. One thing to bear in mind is that
eslint-plugin-jsx-a11yshould be v5 instead of the latest (v6); otherwise each file creates a warning:Here's a one-liner hack that temporary helped me
npm startwithout downgrading npm to v4:Timer commentedon Jul 13, 2017
May I ask why you're against downgrading to
npmv4?npm@5was a rushed release so that it could be included with Node 8; I would not expect it to be stable for some time.In the interim, I'd continue to use
npm@4or Yarn if you're concerned about having a Lockfile.I'm not sure what the npm cli team is really doing -- for example,
5.2.0was released which contained this issue's bug; they reverted the commit but have not made a patch release, leaving people to suffer with this problem for days.I would not expect the npm cli team to be pressed by any authority until Node 8 is about to enter LTS.
aleix10kst commentedon Jul 13, 2017
I've tried with npm v4 and I confirm it works. I had the same issue, so downgrading to v4 it takes only 20 secs and it's the "best" solution...
gaearon commentedon Jul 13, 2017
I can empathize with npm here because the only way they can find bugs after a rewrite is by pushing out releases and fixing regressions. I’m hopeful that it should get better after 5.2.1.
Timer commentedon Jul 13, 2017
I'd like to stress that I'm very grateful for the effort the npm team puts in.
I do not want to undermine what they're doing in any way; I just wish they'd push bug fixes on a slightly quicker-schedule since so many people are already treating it as stable.
I hope I didn't come off too aggressive.
kachkaev commentedon Jul 14, 2017
All worked for me after upgrading to npm 5.3. Can anyone else confirm please?
AlexeyGorokhov commentedon Jul 15, 2017
Upgrading to npm@5.3.0 solves the problem.
piotr-cz commentedon Aug 25, 2017
Upgrade to npm v5.3.0 didin't work for me, I had to switch to yarn