'create-react-app' is not recognized as an internal or external command

前端 未结 22 1538
孤城傲影
孤城傲影 2020-12-24 11:51

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

相关标签:
22条回答
  • 2020-12-24 12:42

    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

    0 讨论(0)
  • 2020-12-24 12:42

    I reinstalled node.js and added the path given by npm root -g command to my path variable to get it working.

    0 讨论(0)
  • 2020-12-24 12:45

    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

    0 讨论(0)
  • 2020-12-24 12:46

    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]

    0 讨论(0)
  • 2020-12-24 12:46

    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.

    0 讨论(0)
  • 2020-12-24 12:46

    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.

    0 讨论(0)
提交回复
热议问题