the term ng is not recognized as the name of a cmdlet in angular [duplicate]

穿精又带淫゛_ 提交于 2020-07-08 03:44:24

问题


I'm very new to angular and i am learning from a project that has been developed some months back.

node v is 12.13.1 npm v is 6.12.1

  • I'm working in windows Operating system.
  • when i tried ng --version or ng -v or ng v it is showing "the term ng is not recognized as the name of a cmdlet in angular".
  • But using npm list -global --depth 0 shows me that @angular/cli@8.3.21.
  • to run the application im using npm start since ng serve is not working.

I tried Updating angularCli by following the steps given in the below link but still the same. https://www.npmjs.com/package/@angular/cli

please help me to solve this issue. Thanks in advance.


回答1:


Open Node JS command Prompt

First uninstall angular cli globally

npm uninstall -g @angular/cli

npm cache clean --force

Install latest angular cli

npm install -g @angular/cli

You will be able to access ng variable in Node JS command prompt only. If you are using any other terminal such as windows CMD or bash ng command will not work. To make it work you need to set npm environment variables. To set environment variables you need admin access.



来源:https://stackoverflow.com/questions/59545882/the-term-ng-is-not-recognized-as-the-name-of-a-cmdlet-in-angular

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!