The term 'ng' is not recognized as the name of a cmdlet

后端 未结 30 971
灰色年华
灰色年华 2020-12-01 00:24

Today, while working through some basic AngularJS Intro, I ran into a problem.

I opened PowerShell to get going on the project. NPM worked.

I was able to in

30条回答
  •  南方客
    南方客 (楼主)
    2020-12-01 01:13

    The first path in the path variable needs to be the NPM path. Opening the Node.js command prompt I found that the ng command worked there. I dug into the shortcut and found that it references a command to ensure the first Path variable is NPM. To Fix:

    1. Right Clicked on My Computer (windows)
    2. Selected Advanced System Settings
    3. Clicked "Environment Variables"
    4. Under "Path" variable, made the FIRST value listed %AppData%\npm

    Once I did that I was able to close powershell and reopen and all worked.

提交回复
热议问题