ng:使用angular-cli创建新项目时找不到命令

问题描述:

使用(npm install -g angular-cli)全局安装了angular-cli,但是当我尝试使用ng new my-project创建项目时,抛出了错误:

Installed angular-cli globally using (npm install -g angular-cli) but when I'm trying to create project using ng new my-project it is throwing error:

ng:找不到命令

ng: command not found

问题很简单,npm不了解ng

只需运行npm link @angular/cli,它就可以无缝运行.

Just run npm link @angular/cli and it should work seamlessly.