【问题标题】:npm ERR! when starting Angular Frontend App [duplicate]npm 错误!启动Angular前端应用程序时[重复]
【发布时间】:2021-10-13 18:03:14
【问题描述】:

> ng serve

sh: ng: command not found
npm ERR! code ELIFECYCLE

npm ERR! syscall spawn

npm ERR! file sh

npm ERR! errno ENOENT

npm ERR! frontend@0.0.0 start: `ng serve`

npm ERR! spawn ENOENT

npm ERR! 

npm ERR! Failed at the frontend@0.0.0 start script.

npm ERR! This is probably not a problem with npm. There is likely additional
 logging output above.

npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/.npm/_logs/2021-08-09T13_47_00_579Z-debug.log

Process finished with exit code 1

【问题讨论】:

  • 您收到一条消息说您想念node_modules 您是否尝试运行npm install?阅读更多关于 npm here

标签: javascript angular npm


【解决方案1】:

它说它找不到命令ng。你跑npm install -g @angular/cli了吗?

如果您正在运行多个终端窗口,如果您将其安装在另一个终端窗口中,则可能需要重新启动运行 ng 的窗口。

【讨论】:

    猜你喜欢
    • 2018-06-16
    • 2019-04-18
    • 2020-07-03
    • 1970-01-01
    • 1970-01-01
    • 2018-09-15
    • 1970-01-01
    • 2013-09-27
    • 1970-01-01
    相关资源
    最近更新 更多