今天构建angular项目的时候,执行:

  1. ng new -
  2. ng generate class - 后出现了下面的问题:

This command can only be run inside of a CLI project.

可是我明明之前已经执行过 npm install -g @angular/cli 命令行,也就是我已经全局安装了cli,项目应该是angular-cli的。

然后在stackOverflow里差了下,改成npm install -g @angular/[email protected]就行了。如下图: angular-cli的安装问题

转载于:https://my.oschina.net/hyzccc/blog/1835216

相关文章: