Skip to content

Error: Cannot find module 'C:\WorkPlace\moo\iyin\node_modules\react-scripts\package.json #708

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

Closed
starerp-ai opened this issue Sep 23, 2016 · 14 comments

Comments

@starerp-ai
Copy link

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

Description

Error: Cannot find module 'C:\WorkPlace\moo\iyin\node_modules\react-scripts\package.json

Expected behavior

install create-react-app successfully

Actual behavior

installation failed

Environment

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

  1. npm ls react-scripts (if you haven’t ejected): [email protected]
  2. node -v: v6.5.0
  3. npm -v:3.10.3

Then, specify:

  1. Operating system:win 10
  2. Browser and version: chrome
@amilajack
Copy link

Try manually checking if the file exists. If it doesnt exist, that's probably a bug

@starerp-ai
Copy link
Author

There is only one file in the project directory generated by CLI,
which is package.json
the content of this file is below:
{
"name": "test",
"version": "0.1.0",
"private": true
}

@gaearon
Copy link
Contributor

gaearon commented Sep 23, 2016

This means your installation failed (or something interrupted it). Maybe there was a network failure. Try running create-react-app again and make sure it finishes successfully. If it doesn't work please paste the complete output from that command.

@starerp-ai
Copy link
Author

still not work!
image

@gaearon
Copy link
Contributor

gaearon commented Sep 23, 2016

Could this be related? Can you try solutions in this question?

http://stackoverflow.com/questions/19569990/npm-install-doesnt-work-in-windows-powershell

@gaearon
Copy link
Contributor

gaearon commented Sep 23, 2016

Does a file called c:\package.json exist?

@starerp-ai
Copy link
Author

starerp-ai commented Sep 23, 2016

package.json does not exist in C:
npm works normally except for this case.

@gaearon
Copy link
Contributor

gaearon commented Sep 23, 2016

Can you try creating a project anywhere else on the disk?

@starerp-ai
Copy link
Author

I have tried creating projects in different directories many times, same error reported

@amilajack
Copy link

Last resort would be to use something like Docker or vagrant

@gaearon
Copy link
Contributor

gaearon commented Sep 24, 2016

Can you try updating npm? Might be some bug.

npm i -g npm@next

@starerp-ai
Copy link
Author

starerp-ai commented Sep 24, 2016

npm updated, still not work.

I saw react-scripts/package.json is generated in C:\node_modules,
not in C:\react1\node_modules which is expected to be here.

image

@gaearon
Copy link
Contributor

gaearon commented Sep 24, 2016

This is interesting. Can you look into why this happens?

@gaearon
Copy link
Contributor

gaearon commented Sep 30, 2016

Closing as it appears that this is some kind of localized issue happening with your npm setup. I’m happy to reopen if you could look into why this happens and provide some hints, or if more users hit this. At the moment it doesn’t appear very actionable for us, unfortunately.

@gaearon gaearon closed this as completed Sep 30, 2016
@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

3 participants