How can I update npm on Windows

0 votes

I tried this:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

but it didn't work.

How do I do this on Windows?

Jul 13, 2020 in Node-js by kartik
• 37,530 points
2,961 views

1 answer to this question.

0 votes

Hello @kartik,

To update NPM, this worked for me:

  • Navigate in your shell to your node installation directory, eg C:\Program Files (x86)\nodejs
  • run npm install npm (no -g option)
Hope it works!!
ThanK you!!
answered Jul 13, 2020 by Niroj
• 82,780 points

Related Questions In Node-js

0 votes
1 answer

How do I update devDependencies in NPM?

Hello @kartik, To update package.json in addition to ...READ MORE

answered Jul 16, 2020 in Node-js by Niroj
• 82,780 points
1,718 views
0 votes
1 answer

How can i update multiple documents in mongoose?

Hello @kartik, Use: Device.updateMany({}, { cid: '' }); Hope it ...READ MORE

answered Oct 15, 2020 in Node-js by Niroj
• 82,780 points
1,162 views
0 votes
1 answer

How do I send command line arguments to npm script?

Hello @kartik, The syntax is as follows: npm run ...READ MORE

answered Jul 8, 2020 in Node-js by Niroj
• 82,780 points
7,170 views
0 votes
1 answer

How do I update Node.js?

Hello @kartik, First update npm, npm install -g npm stable Then ...READ MORE

answered Jul 8, 2020 in Node-js by Niroj
• 82,780 points
198 views
0 votes
1 answer

jQuery AJAX fires error callback on window unload - how do I filter out unload and only catch real errors?

Hello, In the error callback or $.ajax you have three ...READ MORE

answered Apr 27, 2020 in Java-Script by Niroj
• 82,780 points
1,053 views
0 votes
1 answer

How do I pass command line arguments to a Node.js program?

Hello @kartik, If your script is called myScript.js ...READ MORE

answered May 5, 2020 in Java-Script by Niroj
• 82,780 points
1,436 views
0 votes
1 answer

Error:Issue when trying to use IN() in wordpress database

Hello @kartik, Try this code : // Create an ...READ MORE

answered May 8, 2020 in PHP by Niroj
• 82,780 points
196 views
+2 votes
1 answer

How do I debug Node.js applications?

Hello @kartik, Use node-inspector  from any browser supporting WebSocket. Breakpoints, ...READ MORE

answered Jul 8, 2020 in Node-js by Niroj
• 82,780 points
206 views
0 votes
1 answer

How can I set NODE_ENV=production on Windows?

Hello @kartik, It would be ideal if you ...READ MORE

answered Jul 13, 2020 in Node-js by Niroj
• 82,780 points
9,552 views
0 votes
1 answer

How can I get npm start at a different directory?

Hello @kartik, Try using: npm start --prefix path/to/your/app & inside ...READ MORE

answered Jul 14, 2020 in Node-js by Niroj
• 82,780 points
4,577 views