Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
780 views
in Technique[技术] by (71.8m points)

node.js - Why npm start is throwing events.js:187 throw er; // Unhandled 'error' event in my react project?

While starting the server for the first time just after the code checkout , my react js project is throwing error "events.js:187 throw er; // Unhandled 'error' event" . I have node 12.13.0 and npm 6.12.0 . Log file attached log file

events.js:187
      throw er; // Unhandled 'error' event
      ^



    Error: spawn cmd ENOENT
        at Process.ChildProcess._handle.onexit 
       (internal/child_process.js:264:19)
       at onErrorNT (internal/child_process.js:456:16)
       at processTicksAndRejections (internal/process/task_queues.js:80:21)
    Emitted 'error' event on ChildProcess instance at:
       at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
       at onErrorNT (internal/child_process.js:456:16)
       at processTicksAndRejections (internal/process/task_queues.js:80:21) {
    errno: 'ENOENT',
    code: 'ENOENT',
    syscall: 'spawn cmd',
    path: 'cmd',
    spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:3000/' ]
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If your system is windows, set your environment variable, add %SystemRoot%system32 to your PATH I met this error yesterday,hope it works to you. Don't forget reboot you PC


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...