In VS Code when I am running command ng build
, getting error
PS D:\Dashboard\Test1> ng build
ng : The term 'ng' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.
At line:1 char:1
+ ng build
+ ~~
+ CategoryInfo : ObjectNotFound: (ng:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I have added these environment variable in Path
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;
C:\Users\Avind\AppData\Local\Programs\Microsoft VS Code\bin;
C:\Users\Avind\AppData\Roaming\npm;
How can I get rid of this issue?
Note: I have node.js
at C:\Program Files\nodejs
. From command prompt ng new project
not working but working from node.js
command.
Edit 1: After executing npm install -g @angular/cli@latest
from VS Code terminal getting below msg and ng
cmd not working
PS D:\Path\Test1> npm install -g @angular/cli@latest
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
C:\Users\Avind\AppData\Roaming\npm\ng -> C:\Users\Avind\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng
> @angular/[email protected] postinstall C:\Users\AR20095474\AppData\Roaming\npm\node_modules\@angular\cli
> node ./bin/postinstall/script.js
+ @angular/[email protected]
updated 1 package in 53.477s
You need to install the latest angular cli to make the ng command work, you can run it from the command termial or visual studio code terminal
npm install -g @angular/cli@latest
if still not working, uninstall and reinstall node.js
from program and feature
.
As here Angular CLI, Make sure you installed Angular CLI
You can run this command from anywhere on your system
npm install -g @angular/cli
ng --version
Should print something like that
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 13.1.2
Node: 16.13.1
Package Manager: npm 8.1.2
OS: win32 x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.1301.2 (cli-only)
@angular-devkit/core 13.1.2 (cli-only)
@angular-devkit/schematics 13.1.2 (cli-only)
@schematics/angular 13.1.2 (cli-only)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With