When I run create-react-app
in the CLI I get the following error message back:
$ create-react-app udacity-goals-todo
internal/modules/cjs/loader.js:573
throw err;
^
Error: Cannot find module 'fs-extra'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:571:15)
at Function.Module._load (internal/modules/cjs/loader.js:497:25)
at Module.require (internal/modules/cjs/loader.js:626:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/usr/local/lib/node_modules/create-react-app/createReactApp.js:40:12)
at Module._compile (internal/modules/cjs/loader.js:678:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
I have tried uninstalling and reinstalling create-react-app
as well as reinstalling fs-extra
.
Any ideas on how to get this up and running again?
you can fix this by uninstalling create-react-app and re-installing it
1) right-click finder desktop widget
2) click "go to folder"
3) type " /usr/local/lib/node_modules " then enter
4) delete create-react-app folder
5) in terminal type in " npm i -g create-react-app "
I have had a similar issue earlier with the create-react-app and 'tar' module. I did the following steps to fix it:
npm cache clear --force
npm i
npm i -g create-react-app
I just had the same issue. Although I've always run create-react-app using npx.
The issue was solved by cleaning the yarn cache, yarn cache clean
Facing same or similar issue when running the following:
npx create-react-app .
The following error was thrown:
internal/modules/cjs/loader.js:582
throw err; ^
Error: Cannot find module 'C:\Users\user-name\AppData\Roaming\npm\node_modules\npm\bin\npx-cli.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15) at Function.Module._load (internal/modules/cjs/loader.js:506:25) at Function.Module.runMain (internal/modules/cjs/loader.js:741:12) at startup (internal/bootstrap/node.js:285:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
Solution:
Installing or updating npx
with the following command:
npm i -g npx
Then running again the original command for project creation in the project's folder:
npx create-react-app .
Then it starts creating your project as expected:
Creating a new React app in
<app-folder-path>
.Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
Hope that helps for future searchers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With