2

I'm using the "Getting Started" guide because I've been experiencing endless errors trying to create a react app so far when following tutorials.

And straight away I'm running into a problem. When I run npx create-react-app my-app I get the following:

Cannot find module 'C:\Users\Aristophanes\node_modules\create-react-app\index.js'

Can anyone advise me what I'm doing wrong? Thanks.

2
  • 3
    Install CRA globally and then try. Commented May 15, 2019 at 13:41
  • 1
    Thank you, this worked. I had previously uninstalled globally because that is what is advised on the "Getting started" guide. Commented May 15, 2019 at 14:26

5 Answers 5

1

This must be a problem related with your node installation (maybe you removed manually create-react-app package?). I'd recommend following these steps:

  1. Uninstall node and npm
  2. Delete the npm cache and npm modules in your machine (In Windows machine you can usually find them at C:\Users\ {username} \AppData\Roaming\npm-cache and C:\Users\ {user name} \AppData\Roaming\npm) respectively.
  3. Install node and npm again

If you really don't want to delete node and npm, try step 2 and see if that works. Following these steps did the job for me, hope that helps you.

Sign up to request clarification or add additional context in comments.

1 Comment

worked for me too. Do not forget to delete the mentioned folders otherwise you have to do it twice like me
1

I had same issue a few times. Every time I was searching thru net for a solution, and for every time i just typed in terminal

npm i node

and its just started working

Comments

1

Thanks for solutions!

The great solution:

npm install --save react-clear-cache

npm uninstall -g create-react-app

npm install -g --force create-react-app

Comments

0

I think you might miss installing Node and npm in your machine.

1 Comment

Nope I definitely have node and NPM installed.
0

You'll have to install the library to clean the browser cache after React app updates by running:

npm install --save react-clear-cache

Then uninstall React globally, using

npm uninstall -g create-react-app

then reinstall React globally again:

$ npm install -g create-react-app

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.