When the front-end project used the NPM tool Live-Server to handle the hot update of the page, an error message was reported as follows:
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19) npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\asus\AppData\Roaming\npm-cache\_logs\2019-09-03T13_39_22_260Z-debug.log
Solutions:
Find PATH in the environment variable and add %SystemRoot%\system32 at the end; Notice the semicolon
Restart the computer after adding it will take effect!
Why live- Server?
Local development often requires building temporary services. Http-server is the first thing that comes to mind, but it is popular to modify the file browser to automatically flush the hot Socketing (such as Live-Reload), but if you want your browser to automatically open your project, use Opener.
Live-server implements all of the functionality of the three plug-ins, and it’s easy to launch a professional-looking local service, so choose Live-Server.
Command for Live-Server:
Installation:
npm install -g live-server
Start the project by specifying the port number:
live-server --port=port number
Read More:
- How to Fix Error 1069:The service did not start due to a logon failure
- How to Solve Error: spawn xxxx ENOENT
- [Solved] GLSL Lint: Failed to spawn ‘glslangValidator‘ binary. Error: spawn glslangValidator.exe ENOENT
- How to Fix the common Warning Errors after Vue Project Startup
- How to Fix Microsoft SQL Server Error 1326
- How to Fix TNS 12560 Error
- How to Fix Spoolsv.exe Application Error
- How to Fix win10 video dxgkrnl fatal error
- How to Solve Cocoapods Installation Failure
- How to Fix IIS7.5 Disallowed Parent Path Error
- How to Fix Webpack run error webpack dev server
- HTTP Error 500.30 – ANCM In-Process Start Failure
- Websocket: How to Fix Error Read Econnreset
- How to Solve Error: Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI]
- WordPress update failed 429 too many requests (How to Fix)
- How to Fix Failed to load resource: the server responded with a status of 404()
- How to Fix PVE Issues: ERROR: migration aborted
- (How to Fix) Ora-00600: internal error code, arguments: [4194]
- How to Fix the printer error 0x00000709 on Windows
- How to Fix NSS error 12190 in curl accessing to HTTPS