Problem with npm start (error : spawn cmd ENOENT)

后端 未结 5 1466
盖世英雄少女心
盖世英雄少女心 2020-12-03 15:46

I have a problem with my application. Because before when I created an application it worked, but now, it shows me this error and I do not know why and the things I have to

相关标签:
5条回答
  • 2020-12-03 16:30

    If someone hits this coming from Angular 2+, remove the --open from ng serve or run without this option.

    0 讨论(0)
  • 2020-12-03 16:44

    Solution 1

    Set your environment variable to C:\Windows\System32 . This works for me.

    Sets System variable

    Solution 2


    If the first one doesn't work follow the 2nd steps. Navigate to your project folder and type this command >>>

    rm -rf node_modules
    
    rm package-lock.json
    
    rm  yarn.lock
    
    npm cache clear --force
    
    npm install
    

    Solution 3

    Downgrade react-scripts in package.json file

    0 讨论(0)
  • 2020-12-03 16:44

    I had the same problem after I tried to install Mongo DB. I found out that this problem only exists with react-scripts@3.0.0. Try to reinstall your npm with a different react script version. Simply go to your folder in command and reinstall like this:

    npm install react-scripts@2.1.8
    npm start
    

    After that the app worked for me again.

    0 讨论(0)
  • 2020-12-03 16:47

    For all those Who've come to this problem from react scripts not starting. The solution is

    1. Go to search bar and write environment variables. You should see an option to called edit system environment variables or something similar.
    2. Under the Advanced section there is a enivronment variable button. click it.
    3. After that you will see an option named path click on it.
    4. click add button and add following directory C:\Windows\System32.
    5. close down your editor and restart your command terminal. Problem should be resolved now
    0 讨论(0)
  • 2020-12-03 16:52

    Add C:\Windows\System32 to the global PATH environment variable.

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