---
title: "Upgrade npm"
date: "2015-04-18"
category: "node"
slug: "upgrade-npm"
---

When installing newer packages, npm may report that it is too old:

**Sample error:**

Sails.js Installation - Error
--------------------------------------------------------
Your npm-Version is too old:
Sails require npm >= 1.4.0 (you currently have 1.3.6)
Please update the installed npm (Node Package Manager)
 to install Sails.
--------------------------------------------------------

## Solution

Upgrade npm by running:

`npm install -g npm`

A new copy of npm will be installed in `/usr/local/bin`, overriding the system default in `/usr/bin`.

To install an updated npm locally for a specific project directory, omit the `-g` flag:

`npm install npm`
