命令行文本:
C:\Users\User\Desktop>npm install -g @angular/cli
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
C:\Users\User\AppData\Roaming\npm\ng -> C:\Users\User\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng
@angular/cli@10.1.7 postinstall C:\Users\User\AppData\Roaming\npm\node_modules\@angular\cli
node ./bin/postinstall/script.js
@angular/cli@10.1.7
added 276 packages from 206 contributors in 333.421s
C:\Users\User\Desktop>ng new contacts
'ng' is not recognized as an internal or external command,
operable program or batch file.
已经尝试:
答案 0 :(得分:0)
首先,您必须安装最新的节点软件包,然后无需在本地安装angular软件包
在每个命令中,在ng之前仅使用npx
npx ng new newApp
npx ng serve
npx ng generate component login
npx ng ...
这将为您工作。