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

前端 未结 22 1536
孤城傲影
孤城傲影 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:31

    If above solution not working try this on it will work 100%

    0)first of all install package "npm create-create-app -g" or "yarn add create-react-app" then

    1)open cmd and type "npm root -g" this command will give you path of node_model directory for global packages

    2) copy that path only upto npm directory eg.C:\Users\vchaudhari\AppData\Roaming\npm

    3) open environmental variables in windows and pest that command in that save it .

    4) close current cmd and open new cmd and use command "create-react-app demoapp"

    5) Enjoy :-)

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

    I solved the problem by uninstalling create-react-app:

    npm uninstall create-react-app
    

    then install with the following command:

    npm install -g create-react-app
    
    0 讨论(0)
  • 2020-12-24 12:34

    I'm adding this because this pops up on Google and I was having trouble.

    I'm on Windows 10 and I searched for 'create-react-app' in C:\ and the path was C:\Users\Admin\AppData\Roaming\npm\node_modules.

    I added that to the Environment Variables > Path and the command works now.

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

    Do the following from TERMINAL:

    • cd myReactApp
    • npx create-react-app .

    This should work!

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

    For me just create-react-app project-name worked after adding path C:\Users\user\AppData\Roaming\npm\node_modules to my environment variables.

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

    Try with this npx create-react-app my-app

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