4

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?

norbitrial
  • 12,734
  • 5
  • 20
  • 46
Mike Bauer
  • 41
  • 1
  • 2

4 Answers4

4

you can fix this by uninstalling create-react-app and re-installing it

  • For mac users

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 "

  • for window users, i dont know where the globals folder is sorry. i will update this when i find it
mayo19
  • 329
  • 3
  • 13
2

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
Parthipan Natkunam
  • 708
  • 1
  • 12
  • 15
1

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

Gustav
  • 1,363
  • 1
  • 12
  • 24
0

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!

norbitrial
  • 12,734
  • 5
  • 20
  • 46