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
You should update node js to latest version. Otherwise uninstall node js and install it again.
Run Powershell or command prompt not as administrator.
First setup Node.js, then go to your project folder with the command prompt such as D:\project and then run this command:
npm install -g @angular/cli
Now run ng command. This work for me.
I used the following:
npm run ng serve
It worked for me without need to set Environment variables.
I had to install a typescript after it:
npm install typescript@">=3.4 <3.6"
For VSCode Terminal
First open cmd
and install angular-cli
as global
npm install -g @angular/cli
Then update your Environment Variables following this step
win + s
// this will open search box%AppData%\npm
inside PATH
OK
and close.Now you can restart your VSCode
and it will work as it will normally do.
Selected Advanced System Settings enter image description here Clicked "Environment Variables" enter image description here Under "Path" variable, made the FIRST value listed %AppData%\npm enter image description here I did that.Close powershell and reopen. all worked