How to install npm

A question we get asked often is “what’s the best, npm-recommended way of installing npm?” Weirdly, there are no good, recent sources for this. I’m going to fix that on the main site, but I thought I’d post quickly here.

The best way to install npm is to install node using the node.js installer. npm is installed as part of node.

It’s over at nodejs.org. It will give you a recent, working version of npm with all the paths in the expected places. This is the version that npm Inc and the Node.js project both support.

Once you’ve installed Node.js, you can make sure you’ve got the very most recent version of npm using npm itself:

sudo npm install npm -g

(on Windows, you can drop the “sudo” but you should run it as administrator). Running this update will give you the most recent stable version of npm, also supported by npm Inc.

Obviously, no matter how you install npm, we’ll do our best to make sure it works for you, but if you installed it some other way, you should try this recommended way first.

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

How do I create a MySQL database?

  Login to your cPanel and click on MySQL Databases Enter the name of the database in the...

How do I downgrade my shared hosting account?

  A hosting account can only be downgraded at the point of renewal. Before downgrading your...

How do I transfer my hosting account to TFhost?

At the moment, we can only assist you with the transfer of all the contents of your hosting...

How to change your cpanel password

  To change the Cpanel password of any of your accounts, you have to log into your TFhost...

How to move an addon domain from one cPanel to another

  Please note this is not a transfer type supported by TFhost. We will only move content...