今天在启动项目时ng serve
或cnpm start
时,突然报如下错误:
问题1:
You have to be inside an Angular CLI project in order to use the serve command.
尝试1:
输入:cnpm install -g @angular/cli@latest
,再次启动还是不行,报如下错误
问题2:
经查资料和再看错误提示,人家都给出提示了,于是进行了再次尝试:
尝试2:
输入:cnpm install --save-dev @angular/cli@latest
再次启动:ng serve
启动成功!