【问题标题】:Angular2 Quickstart cannot start with lite-serverAngular2 快速入门无法从 lite-server 开始
【发布时间】:2016-07-03 09:00:12
【问题描述】:

我一直试图让 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 机器上并没有持续存在。

感谢您的支持:)

【问题讨论】:

标签: node.js windows typescript angular lite-server


【解决方案1】:

我有同样的问题,同样的版本号和一切。将“C:\Windows\System32\”添加到系统 PATH 变量可以解决问题。我想了很久。

【讨论】:

    【解决方案2】:

    嗯,我自己修好了。我必须用“C:\Windows\System32\”更新我的路径变量。

    问题出在错误信息> Error: spawn cmd ENOENT

    【讨论】:

      猜你喜欢
      • 2016-04-21
      • 2016-04-20
      • 2019-04-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-11
      • 2020-11-26
      • 1970-01-01
      相关资源
      最近更新 更多