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

Running into issue when upgrading from 0.4.1->0.4.2 #676

Closed
erikschlegel opened this issue Sep 18, 2016 · 14 comments
Closed

Running into issue when upgrading from 0.4.1->0.4.2 #676

erikschlegel opened this issue Sep 18, 2016 · 14 comments
Milestone

Comments

@erikschlegel
Copy link

erikschlegel commented Sep 18, 2016

If you are reporting a bug, please fill in below. Otherwise feel to remove this template entirely.

Description

Running into an error when I run npm start Error: Cannot find module 'lru-cache'
What are you reporting?
An error.

Expected behavior

The Webpack dev server to properly start.
Tell us what you think should happen.

Actual behavior

Receiving the following error.

react-scripts start

module.js:327
throw err;
^

Error: Cannot find module 'lru-cache'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (C:\Users\erisch\Source\Repos\Orion-Client\node_modules\react-scripts\node_modules\cross-spawn\lib\parse.js:4:11)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)

Tell us what actually happens.

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven’t ejected):
    $ npm ls react-scripts
    npm WARN unmet dependency C:\Users\erisch\Source\Repos\Orion-Client\node_modules\react-scripts\node_modules\extract-text-webpack-plugin requires async@'^1.5.0' but will load
    npm WARN unmet dependency C:\Users\erisch\Source\Repos\Orion-Client\node_modules\async,
    npm WARN unmet dependency which is version 2.0.1
    npm WARN unmet dependency C:\Users\erisch\Source\Repos\Orion-Client\node_modules\react-scripts\node_modules\webpack requires async@'^1.3.0' but will load
    npm WARN unmet dependency C:\Users\erisch\Source\Repos\Orion-Client\node_modules\async,
    npm WARN unmet dependency which is version 2.0.1
    Fortis-Client@0.0.1 C:\Users\erisch\Source\Repos\Orion-Client
    └── react-scripts@0.4.2
  2. node -v:
    v4.4.7
  3. npm -v:
    2.15.8

Then, specify:

  1. Operating system: Windows 10
  2. Browser and version: Chrome

Reproducible Demo

Please take the time to create a new app that reproduces the issue.
Unable to create a new app either. I receive the following error.
$ create-react-app erik-app
Creating a new React app in C:\Users\erisch\Source\Repos\erik-app.

Installing packages. This might take a couple minutes.
Installing react-scripts from npm...

npm WARN optional dep failed, continuing fsevents@1.0.14
react-scripts@0.4.2 node_modules\react-scripts
module.js:327
throw err;
^

Error: Cannot find module 'graceful-fs'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (C:\Users\erisch\Source\Repos\erik-app\node_modules\react-scripts\node_modules\fs-extra\lib\index.js:4:11)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)

Alternatively, you could copy your app that experiences the problem and start removing things until you’re left with the minimal reproducible demo.

(Accidentially, you might get to the root of your problem during that process.)

Push to GitHub and paste the link here.

By doing this, you're helping the Create React App contributors a big time!
Demonstrable issues gets fixed faster.

@gaearon
Copy link
Contributor

gaearon commented Sep 18, 2016

Can you consistently reproduce this?
Could there be some network issue during install?

@erikschlegel
Copy link
Author

erikschlegel commented Sep 18, 2016

Hey Dan - this happens every time. I'm also receiving the following error when trying to create a new site. Network is also working fine.

$ create-react-app erik
Creating a new React app in C:\Users\erisch\Source\Repos\erik.

Installing packages. This might take a couple minutes.
Installing react-scripts from npm...

npm WARN optional dep failed, continuing fsevents@1.0.14
react-scripts@0.4.2 node_modules\react-scripts
module.js:327
throw err;
^

Error: Cannot find module 'graceful-fs'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (C:\Users\erisch\Source\Repos\erik\node_modules\react-scripts\node_modules\fs-extra\lib\index.js:4:11)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)

@gaearon
Copy link
Contributor

gaearon commented Sep 18, 2016

So far I can’t reproduce this with npm 3.
Will try npm 2 soon.

Can you update npm in case it’s their bug?

npm i -g npm@latest

@gaearon
Copy link
Contributor

gaearon commented Sep 18, 2016

Oh okay, I can reproduce this on npm 2.

@erikschlegel
Copy link
Author

After updating npm now getting a completely different error.

erisch@ERISCH-X1GEN3 MINGW64 ~/Source/Repos
$ npm i -g npm@latest
C:\Users\erisch\AppData\Roaming\npm\npm -> C:\Users\erisch\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
npm@3.10.7 C:\Users\erisch\AppData\Roaming\npm\node_modules\npm

erisch@ERISCH-X1GEN3 MINGW64 ~/Source/Repos
$ create-react-app erik
Creating a new React app in C:\Users\erisch\Source\Repos\erik.

Installing packages. This might take a couple minutes.
Installing react-scripts from npm...

(node) warning: possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at TLSSocket.addListener (events.js:239:17)
at TLSSocket.Readable.on (_stream_readable.js:680:33)
at Request. (C:\Users\erisch\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-client\lib\request.js:153:7)
at emitOne (events.js:77:13)
at Request.emit (events.js:169:7)
at ClientRequest. (C:\Users\erisch\AppData\Roaming\npm\node_modules\npm\node_modules\request\request.js:791:10)
at emitOne (events.js:82:20)
at ClientRequest.emit (events.js:169:7)
at tickOnSocket (_http_client.js:502:7)
at onSocketNT (_http_client.js:514:5)
(node) warning: possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at TLSSocket.addListener (events.js:239:17)
at TLSSocket.Readable.on (_stream_readable.js:680:33)
at Request. (C:\Users\erisch\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-client\lib\request.js:153:7)
at emitOne (events.js:77:13)
at Request.emit (events.js:169:7)
at ClientRequest. (C:\Users\erisch\AppData\Roaming\npm\node_modules\npm\node_modules\request\request.js:791:10)
at emitOne (events.js:82:20)
at ClientRequest.emit (events.js:169:7)
at tickOnSocket (_http_client.js:502:7)
at onSocketNT (_http_client.js:514:5)
(node) warning: possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at TLSSocket.addListener (events.js:239:17)
at TLSSocket.Readable.on (_stream_readable.js:680:33)
at Request. (C:\Users\erisch\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-client\lib\request.js:153:7)
at emitOne (events.js:77:13)
at Request.emit (events.js:169:7)
at ClientRequest. (C:\Users\erisch\AppData\Roaming\npm\node_modules\npm\node_modules\request\request.js:791:10)
at emitOne (events.js:82:20)
at ClientRequest.emit (events.js:169:7)
at tickOnSocket (_http_client.js:502:7)
at onSocketNT (_http_client.js:514:5)
(node) warning: possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limi

@erikschlegel
Copy link
Author

what version of npm are you using?

@gaearon
Copy link
Contributor

gaearon commented Sep 18, 2016

I don’t seem to have this problem after npm install -g npm@next.
Can you try that?

(I know it’s a lousy answer but fighting npm issues is hard.)

@erikschlegel
Copy link
Author

I can create a site now, but still running into the same npm start issue. What I'm trying to do is integrate this package with azure, as the default way to build react based azure web-apps and use kudu for deployment. One of the things I noticed here is that the node modules created under node_modules are not defined in package.json. I guess the only workaround would be to eject and deploy the ejected package.json?

@gaearon
Copy link
Contributor

gaearon commented Sep 18, 2016

I can create a site now, but still running into the same npm start issue.

Which one? Missing lru-cache? It seems like something got messed up on publish, maybe because I was using a buggy npm version. Looking into that now.

One of the things I noticed here is that the node modules created under node_modules are not defined in package.json.

Not sure I understand the question. Can you rephrase?
npm 3 installs nested dependencies in top-level folder so it’s expected.
Just running npm install is enough, you definitely don’t need to eject or add them all to package.json.

@gaearon
Copy link
Contributor

gaearon commented Sep 18, 2016

Confirming this was a result of bad publish.
I’m publishing a version right now that I think should fix this.

@gaearon gaearon added this to the 0.4.3 milestone Sep 18, 2016
@erikschlegel
Copy link
Author

erikschlegel commented Sep 18, 2016

Scratch the question I earlier asked. I'm able to create a new site and run npm start with using react-scripts 0.4.2. The issue seems isolated to npm version 2.

@gaearon
Copy link
Contributor

gaearon commented Sep 18, 2016

Fixed with 0.4.3.
Thanks for report and quick replies.

@gaearon gaearon closed this as completed Sep 18, 2016
@gaearon
Copy link
Contributor

gaearon commented Sep 18, 2016

(You don’t need to do anything to use react-scripts@0.4.3 for new projects—it will be installed automatically. The global create-react-app command will stay at 0.4.2 because it doesn’t need to be updated. In existing projects, you can bump react-scripts to 0.4.3 in package.json and run npm install.)

@erikschlegel
Copy link
Author

Thanks a bunch for the quick turnaround Dan. This library rocks!

@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants