我一直在尝试让 Angular2 快速启动应用程序在 Windows 系统上运行,但无法使用“lite-server”成功。
安装依赖项(npm install)后,当我运行应用程序(npm start)时,出现以下错误
> Error: spawn cmd ENOENT
[1] at exports._errnoException (util.js:1007:11)
[1] at Process.ChildProcess._handle.onexit (internal/child_process.js:182:32 )
[1] at onErrorNT (internal/child_process.js:348:16)
[1] at _combinedTickCallback (internal/process/next_tick.js:74:11)
[1] at process._tickCallback (internal/process/next_tick.js:98:9)
[1]
[1] npm
[1] ERR! Windows_NT 6.1.7601
[1] npm ERR! argv "D:\\Softwares\\node6\\node.exe" "D:\\Softwares\\node6\\node_m odules\\npm\\bin\\npm-cli.js" "run" "lite"
[1] npm ERR! node v6.2.2
[1] npm ERR! npm v3.9.5
[1] npm ERR! code
[1] ELIFECYCLE
[1] npm ERR! angular2-starter@0.9.0 lite: `lite-server`
[1] npm ERR! Exit status 1
[1] npm ERR!
[1] npm ERR! Failed at the angular2-starter@0.9.0 lite script 'lite-server'.
[1] npm ERR! Make sure you have the latest version of node.js and npm installed.
[1] npm ERR! If you do, this is most likely a problem with the angular2-starter package,
[1] npm ERR! not with npm itself.
[1] npm ERR! Tell the author that this fails on your system:
[1] npm ERR! lite-server
[1] npm
[1] ERR! You can get information on how to open an issue for this project with:
[1] npm ERR! npm bugs angular2-starter
[1] npm ERR! Or if that isn't available, you can get their info via:
[1] npm ERR! npm owner ls angular2-starter
[1] npm ERR! There is likely additional logging output above.
[1]
[1] npm ERR! Please include the following file with any support request:
[1] npm ERR! D:\Dev\Angular2-JumpStart\npm-debug.log
[1] npm run lite exited with code 1
正如你在我的 node(v6.2.2) 和 npm(v3.9.5) 上面看到的。我也尝试过使用较旧的节点版本,但没有运气。我还全局安装了 lite-server(仅供参考)。
我已经在网上关注并尝试了一些建议,但都没有奏效。
奇怪的是,这个问题在我的 Mac 机器上并没有持续存在。
我感谢您的支持 :)