npm is not recognized as internal or external command operable program or batch file

0 votes

I am completely new to nodejs and have been trying to get nodejs to work on my Windows 2008 box in order to install Karma which I would use for TDDing my AngularJs code. I have done the following steps so far

  1. Install using Chocolatey ==> npm is not recognised

  2. Install using 64-bit nodejs installer from nodejs.org ==> npm is not recognised

  3. At this stage, running where npm gives me c:\User\<Username>\AppData\Roaming\npm which has nothing in it

  4. I figured out that node js is installed in C:\Program Files\nodejs. Opening a command prompt in this directory makes npm work fine.

  5. So I added C:\Program Files\nodejs to PATH only to get the same error again that npm is not recognized

  6. One of the github issues on nodejs repository says that I need to restart the machine and fix it. But that has not helped so far

  7. I do see a Node.js icon in my Start -> Programms menu which takes me to node js console but I'm not sure what to do with that.

Have I missed any important step in the process? I figured out that if I open "Node Js command prompt" from program files, then npm is recognized. How do I make it work on a normal command prompt?

Feb 10, 2022 in Others by Soham
• 9,710 points
11,721 views

1 answer to this question.

0 votes

To your existing lines of code, include this additional line:-

;C:\Program Files\nodejs\

This will enable you to end your Path variable on the "User variable" section of the Environment Variables on the System Properties. Once concluded, reopen your command prompt and type
 

npm

Which should help the program work.

answered Feb 10, 2022 by Rahul
• 9,680 points

Related Questions In Others

0 votes
1 answer

'adb' is not recognized as an internal or external command, operable program or batch file

Set the path of adb into System ...READ MORE

answered Feb 16, 2022 in Others by Aditya
• 7,680 points
7,173 views
0 votes
1 answer

'git rev-parse HEAD' is not recognized as an internal or external command

Hi@akhtar, I also faced the same problem. You ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,460 points
4,155 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,944 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,469 views
0 votes
1 answer

How to completely remove node.js from Windows?

Run npm cache clean --force Uninstall from Programs & ...READ MORE

answered Jun 14, 2022 in Node-js by Neha
• 9,020 points
19,210 views
0 votes
1 answer

ERROR:'keytool' is not recognized as an internal or external command, operable program or batch file

Check if the directory and the keytool ...READ MORE

answered Feb 18, 2022 in Others by Rahul
• 9,680 points
8,768 views
+1 vote
1 answer

ng is not recognized as an internal or external command

I solved this problem in accordance with ...READ MORE

answered Feb 11, 2022 in Others by Rahul
• 9,680 points
16,611 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP