npm start issues with react-scripts 3.4.0

后端 未结 5 762
悲哀的现实
悲哀的现实 2021-01-27 06:27

I know this question has already been asked but I can\'t find a solution. When I run npm start inside a react project, I always get the same logs (see below). The o

相关标签:
5条回答
  • 2021-01-27 06:32

    I finally found a solution. Add the default variables in the machines PATH:

    C:\Windows\system32
    C:\Windows
    C:\Windows\System32\Wbem

    Screenshot of variables location

    0 讨论(0)
  • 2021-01-27 06:34

    Changing the path worked for me. Just to add, on the above solution for those who didn't know how to change the path (same as me) and some more details.

    Here is my way on how to change environment variables on Windows 10:

    • Open the Start Search, type in “env”, and choose “Edit the system environment variables”
    • Click the Environment Variables… button.
    • Go on system variables and under variables find PATH, mark it and click EDIT.
    • On the end of the list add paths - you can simply click on new or on the empty field on the end of list: C:\Windows\system32 C:\Windows C:\Windows\System32\Wbem
    • Remember to have the npm paths as well: C:\Program Files\nodejs C:\Users{yourName}\AppData\Roaming\npm
    • Set the environment variables as needed.
    • The New button adds an additional variable. ...
    • Dismiss all of the dialogs by choosing OK. Your changes are saved!
    • Restart the computer.

    Now it should work!

    0 讨论(0)
  • 2021-01-27 06:34

    It took me two days to resolve this issue.

    Its because of the incompatibility issue of react-scripts so try installing different versions like:

    This worked for me:

    npm install --save react-scripts@2.1.8

    This one did work for many as they claim:

    npm install --save react-scripts@3.3.0

    It should work as it did to me after an arduous struggle.

    0 讨论(0)
  • 2021-01-27 06:40
    1. Open the Start Search, type in “env”, and choose “Edit the system environment variables

    2. Click the Environment Variables Button.

    3. Go on system variables and under variables find PATH, mark it and click EDIT.

    4. On the end of the list add paths - you can simply click on new or on the empty field

    5. Go to your react app folder then go to node_modules and then go to bin folder and then copy url

    6. Paste your url in new path

    0 讨论(0)
  • 2021-01-27 06:51

    Sometimes on windows, I get the same error message randomly if the npm cache is somehow messed up.

    Try to run

    npm cache clean --force
    

    Delete the node_modules folder and the package.lock.json file and run npm install afterward.

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