我正在使用链接中的示例学习angular。但是,当我运行npm start时,它显示错误。我搜索了解决方案,要求更新npm或angular版本,但我已经使用最新版本如下:
npm -v = 6.4.1
node -v = 10.9.0
angular CLI = 6.1.5
我正在使用Windows 7。
> apm@0.0.0 start F:\Angular\Angular-GettingStarted-master\APM-Start
> ng serve -o
npm ERR! file bash
npm ERR! path bash
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn bash
npm ERR! apm@0.0.0 start: `ng serve -o`
npm ERR! spawn bash ENOENT
npm ERR!
npm ERR! Failed at the apm@0.0.0 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\AppData\Roaming\npm-cache\_logs\2018-09-
05T16_12_41_076Z-debug.log
ng serve
之前,你是否运行了npm install
命令? - peinearydevelopmentnpm install
之后,您需要按以下方式运行命令:node_modules/.bin/ng serve
或npm run start
。 - peinearydevelopmentng serve
而不是npm start
。 - SiddAjmera