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 'react-scripts/scripts/init.js' #9501

Open
Mihai-github opened this issue Aug 18, 2020 · 13 comments
Open

Error: Cannot find module 'react-scripts/scripts/init.js' #9501

Mihai-github opened this issue Aug 18, 2020 · 13 comments

Comments

@Mihai-github
Copy link

When creating a brand new react app using the new way: "npx create-react-app my-app" i get the an error and seems to not be a way to fix it easy, I've found a way but I'm curios if the problem is from my pc or something else...

I hope someone can help me understand what is happening 👍

@HemanthDavuluri
Copy link

Can you put the errors log in here?

@Mihai-github
Copy link
Author

Sure, he it it:

Error: Cannot find module 'react-scripts/scripts/init.js'
Require stack:

  • D:\work\my[eval]
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1080:15)
    at Function.Module._load (internal/modules/cjs/loader.js:923:27)
    at Module.require (internal/modules/cjs/loader.js:1140:19)
    at require (internal/modules/cjs/helpers.js:75:18)
    at [eval]:2:20
    at Script.runInThisContext (vm.js:132:18)
    at Object.runInThisContext (vm.js:315:38)
    at Object. ([eval]-wrapper:10:26)
    at Module._compile (internal/modules/cjs/loader.js:1251:30)
    at evalScript (internal/process/execution.js:92:25) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ 'D:\work\my\[eval]' ]
    }

@eddiemonge
Copy link
Contributor

Did you get any errors when you ran the npx command? Or is this error from that?

@Mihai-github
Copy link
Author

I've got this error when I'm running " npx create-react-app my-app " command... and the app is not even created it's deleted when this error appears.
I do not know exacly why because I've watched the docs when create-react-app was globally and i uninstalled it with yarn and npm command

@sammysmart95
Copy link

I got this same issue @Mihal-github but no way out... I tried cleaning my cache and updating my create-react-app yet no head way.. any help please...

@abbasi-naim
Copy link

Just run the code on git bash
$ npm install
$ npm install react-scripts
$ npx create-react-app your-app-name

@abbasi-naim
Copy link

I got this same issue @Mihal-github but no way out... I tried cleaning my cache and updating my create-react-app yet no head way.. any help please...

Just run the code on git bash
$ npm install
$ npm install react-scripts
$ npx create-react-app your-app-name

@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Dec 25, 2020
@iamswain25
Copy link

mine was yarn 3 problem

yarn set version classic

and try again.

@stale stale bot removed the stale label Aug 11, 2021
@powerlesbian
Copy link

mine was yarn 3 problem

yarn set version classic

and try again.

i tried all of these and still can't get it to run node has failed....

@powerlesbian
Copy link

I got this same issue @Mihal-github but no way out... I tried cleaning my cache and updating my create-react-app yet no head way.. any help please...

Just run the code on git bash
$ npm install
$ npm install react-scripts
$ npx create-react-app your-app-name

i tried all of these and still can't get it to run node has failed.... it seems to be an issue with node_modules/react-scripts/scripts/init.js:117:13

node:internal/modules/cjs/loader:936
throw err;
^

Error: Cannot find module 'cra-template/package.json'

@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@MehdiShojaRazavi
Copy link

the same issue

@stale stale bot removed the stale label Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants