ng is not recognized as valid command even after successful npm install
Please provide us with the following information:
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Windows 10
-
Versions. Please run
ng --version. If there's nothing outputted, please run in a Terminal: node --version And paste the result here. v5.9.1 -
Repro steps. Was this an app that wasn't created using the CLI? What change did you do on your code? etc. 'ng' is not recognized as an internal or external command, operable program or batch file.
-
The log given by the failure. Normally this include a stack trace and some more information. Th angular cli version +-- [email protected]
-
Mention any other details that might be useful.
Thanks! We'll be in touch soon.
I did the following:
- Download https://nodejs.org/dist/v6.2.2/node-v6.2.2-x64.msi
- Install
- [Windows key], type "command prompt", right click "Run as Administrator"
npm install -g angular-cli
Open a termina. Run ng. Works
I'm running it on windows 10 as well, and didn't need to run it as an administrator.
@indcoder Can you give me the console log from when you did npm install -g angular-cli?
I still get the same problem
Hi @filipesilva
Thanks for looking into this.
I don't have the logs of the previous install but I ran the npm install again
C:\Users\xxxxxxx\AppData\Roaming\npm\ng -> C:\Users\xxxxxxx\AppData\Roaming\npm\node_modules\angular-cli\bin\ng
C:\Users\xxxxxxx\AppData\Roaming\npm
`-- [email protected]
I think the ng bin is not getting added to the path
AC
Hi @filipesilva Do you still need more info from my end?
I tried to install as an Administrator and I get this error. npm-debug.zip
Upgraded to node v6.2.2 but same error has above....but a big improvement. ng command is working but throws an error.
ng --help module.js:442 throw err; ^
Error: Cannot find module 'rsvp'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.
Ok so I upgraded my node from 5.* to 6.2.2. Nuked the .npm and .npm-cache folders and then installed ng. It works correctly.
I think:
- There is some incompatibility between node 4 or 5.
- Multiple npm install of angular cli messed up the other npm modules.
Sorry it took me a while to get back to you. Weird bug overall, am glad you got it to work.
The missing rsvp module is this issue: https://github.com/angular/angular-cli/issues/1186, it should be fixed next beta.
Hi, I'm facing the same issue with v4.5.0. I want to work on this stable version, is there any way to fix "ng not recognized" error in 4.5.0?
@sthallapelly if you get that message, it means that the npm install failed. Can you open a new issue with the log you get from running the command?
I am also getting the same error: 'ng' is not recognized as an internal or external command, operable program or batch file. Plz guide on how to resolve this..
Thanks in advance
I'm getting the same problem< 'ng' is not recognized as an internal or external command, operable program or batch file
Hi, I installed Nodes 7.2.1, which is latest as of now. Now for Angular 2, i ran command npm install -g angular-cli But, ng command is not being recognized.
Am stuck here. please help
@kingshreyash -- this issue is closed. If you have a bug or feature to report, please open a new issue but it sounds like you have a support question which should be directed to StackOverflow.
😔 On Tue, Dec 13, 2016 at 1:13 PM Jan Nielsen [email protected] wrote:
@kingshreyash https://github.com/kingshreyash -- this issue is closed. If you have a bug or feature to report, please open a new issue but it sounds like you have a support question which should be directed to StackOverflow.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/1149#issuecomment-266816587, or mute the thread https://github.com/notifications/unsubscribe-auth/AXRDSodhObJv6HMKLLTc4TJ20R6xW6xuks5rHuBhgaJpZM4I6C3G .
Hello philipo this is what am getting any help
C:\Users\USER>ng --version 'ng' is not recognized as an internal or external command, operable program or batch file.
C:\Users\USER>node --version v6.9.5
Hi, I installed Nodes 7.2.1, which is latest as of now. Now for Angular 2, i ran command npm install -g angular-cli But, ng command is not being recognized.
Am stuck here. please help
i had similar issue, did a nvm check, found the terminal and the ide were running on different version of node
I was stuck on the same issue for many days. Either 'npm' nor 'ng' commands were recognized within Spring Tool Suite(Eclipse) but it was working in Windows (and Mac) terminals. I updated the user and environment variables, reboot the IDE, but still it was not working. But I have restarted the computer, and now Waaaaaouuh, it works fine. So the best way to do is restart the computer just after installing NodeJs, so that changes can take effects globally.
Hope this comment will help.