【Angular2】You have to be inside an angular-cli project in order to use the generate command

前端之家收集整理的这篇文章主要介绍了【Angular2】You have to be inside an angular-cli project in order to use the generate command前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

背景

需要在项目中建立自己的component
定位到具体的目录下;输入ng g component my-indivi
dual-information
就会显示如下问题,无法创建component

问题

在控制台提示如下问题:

You have to be inside an angular-cli project in order to use the generate command

解决

npm install -g @angular/cli@latest

参考网址:
https://stackoverflow.com/questions/39133782/you-have-to-be-inside-an-angular-cli-project-in-order-to-use-the-build-command-a

https://stackoverflow.com/questions/40868455/how-to-set-folders-to-angular-cli-commands

原文链接:https://www.f2er.com/angularjs/147158.html

猜你在找的Angularjs相关文章