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

来源:互联网 发布:terminal mac 编辑:程序博客网 时间:2024/05/17 07:15

背景

需要在项目中建立自己的component
定位到具体的目录下;输入ng g component my-individual-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

阅读全文
0 0
原创粉丝点击