# How to update npm using nvm

DevFeed: [How to update npm using nvm](<https://devfeed.tech/articles/how-to-update-npm-using-nvm-37326.md>)

Original publisher: [Read original article](<https://muffinman.io/blog/nvm-updating-npm/>)

Author: Stanko

Published: 2017-09-02T00:00:00Z

Content type: tutorial

Language: en

Sources: [Stanko Tadić](<https://devfeed.tech/sources/stanko-tadic.md>)

Topics: [npm](<https://devfeed.tech/topics/npm.md>), [Node.js](<https://devfeed.tech/topics/node-js.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>)

Tags: [command](<https://devfeed.tech/tags/command.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [node-version-manager](<https://devfeed.tech/tags/node-version-manager.md>), [npm](<https://devfeed.tech/tags/npm.md>), [update](<https://devfeed.tech/tags/update.md>)

## AI overview

A tutorial explains how to update npm when Node.js is managed with nvm. It describes locating nvm's Node.js library directory, running npm install npm there, reopening the terminal, and using nvm install-latest-npm as an alternative.

## Source excerpt

If you are JavaScript developer and not using nvm you might want to look at it. Node Version Manager is easy way to install, manage and work with multiple node versions. Recently I got npm update notification, that looks something like this: For some reason, when I had node installed through nvm, npm i -g npm didn't work. However, when I was using a "system" node version, installed from Node.js website, it did. I can't remember the exact error, but it was probably something with my PATH configuration. So I tried to find a path where global packages are installed when using nvm. Once I found it, it was super easy to update npm in that specific folder. # navigate to nvm's node lib folder # (replace v8.4.0 with your version) cd ~/.nvm/versions/node/v8.4.0/lib/ # update npm right there npm install npm # reopen your terminal That's it. Great thing is that npm can update itself. And this works for any other global npm package. Or, as suggested in the comments, just use nvm's command: nvm install-latest-npm