通过(npm install -g @ angular / cli)安装Angular Cli - 获取ng不被识别为外部和内部命令

C:\ Users \ neha> npm install -g @ angular / cli C:\ Users \ neha \ AppData \ Roaming \ npm \ ng - > C:\ Users \ neha \ AppData \ Roaming \ npm \ node_modules \ @angular \ cli \ BIN \纳克

@ angular / cli @ 6.0.8 postinstall C:\ Users \ neha \ AppData \ Roaming \ npm \ node_modules \ @angular \ cli node ./bin/ng-update-message.js

npm WARN回滚回滚node-pre-gyp@0.10.0失败(这可能是无害的):EPERM:不允许操作,rmdir'C:\ Users \ neha \ AppData \ Roaming \ npm \ node_modules \ @angular \ cli \ node_modules \ fsevents \ node_modules'npm WARN rollback roll back needle@2.2.0失败(这可能是无害的):EPERM:不允许操作,lstat'C:\ Users \ neha \ AppData \ Roaming \ npm \ node_modules \ @angular \警告可选SKIPPING可选依赖性:clse \ node_modules \ fsevents \ node_modules'npm警告:fsevents@1.2.4(node_modules \ @angular \ cli \ node_modules \ fsevents):npm WARN notsup SKIPPING OPTIONAL DEPENDENCY:不支持的fsevents@1.2.4平台:通缉{“os”:“darwin”,“arch”:“any”}(当前:{“os”:“win32”,“arch”:“x64”})

  • @ angular / cli @ 6.0.8更新了37.347s中的1个包

C:\ Users \ neha> ng'ng'无法识别为内部或外部命令,可运行程序或批处理文件 .

回答(1)

2 years ago

只需添加%AppData%\ npm;到用户变量(因为%AppData%dir取决于用户)PATH来修复它 .

关于 Github 的相关问题