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.

Aristophanes
  • 475
  • 1
  • 9
  • 21

4 Answers4

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.

Santiago Benitez
  • 364
  • 2
  • 12
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

Fannoth
  • 11
  • 1
0

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

Rajesh Bhartia
  • 690
  • 4
  • 10
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
ITselect
  • 133
  • 1
  • 1
  • 10