I am trying to set up react app using create-react-app command on windows pc. I already used it on my mac computer, and it works well. But I encounter a problem. Here my ste
Environment node -v: v8.9.3 npm -v:4.6.1 yarn --version (if you use Yarn): npm ls react-scripts (if you haven’t ejected): C:\Users\chacker\my-react-app>npm ls react-scripts my-react-app@1.0.0 C:\Users\chacker\my-react-app `-- (empty) Then, specify:
Operating system: windows 7 Browser and version (if relevant): Steps to Reproduce (Write your steps here:)
npm install -g create-react-app log-> C:\Users\chacker\my-react-app>npm install -g create-react-app C:\Users\chacker\AppData\Roaming\npm\create-react-app -> C:\Users\chacker\AppData\R aming\npm\node_modules\create-react-app\index.js C:\Users\chacker\AppData\Roaming\npm `-- create-react-app@1.4.3 create-react-app my-app
I reinstalled node.js and added the path given by npm root -g command to my path variable to get it working.
Use npx create-react-app my-app
. This will solve any issue with the system path variable.
React GitHub documentation suggests this as well. Read Here
simply putting 'npx' in front of the command will solve this if you are running older version of node.
try this and it will work fine.
npx create-react-app [yourProjectName]
I had to add c:\node_modules.bin to my path to run create-react-app
Do a search for create-react-app and use that in your path.
By installing react globally this error can be solved for those who didn't get even after the environmental variable is set. npm i -g create-react-app
. Now the modules will be installed.