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 in Others by Soham
• 8,730 points
1,328 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 by Rahul
• 8,980 points

Related Questions In Others

0 votes
1 answer
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,340 points
1,624 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
914 views
0 votes
1 answer
0 votes
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,440 points
595 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 in Others by Rahul
• 8,980 points
887 views
0 votes
1 answer

ng is not recognized as an internal or external command

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

answered Feb 11 in Others by Rahul
• 8,980 points
1,120 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP