

Node.js fundamentals: how to upgrade the Node.js version | The Holmes Office You can always update it by manually downloading the latest version and installing it yourself! Other option is to install it via a PPA by chris-lea sudo add-apt-repository ppa:chris-lea/node.js To see if it actually upgraded, run: node -v Or just tell it to install the latest stable version. You can tell it to install a specific version like so: sudo n 0.8.11 You can update nodejs by using npm itself, a PPA, or manually.Ĭheck the current version you have: node -v What do I have to do to update npm to the latest version? I also tried using n (as suggested in How can I update my nodeJS to the latest version?) to update, but it affects neither npm nor node: node sudo npm install -g n

It is my understanding that you should be able to update npm using npm install -g npm, but the command has no effect on the npm being used: npm sudo npm install -g npm I noticed that the npm version is somewhat old, so I wanted to check the problem with the latest release. Let's say we depend on lodash version ^3.9.2, and we have that version installed under node_modules/lodash.I'm having issues with npm in a Vagrant box I'm setting up. When you run npm update, npm checks if there exist newer versions out there that satisfy specified semantic versioning ranges and installs them.


Instead of npm install, you can use npm update to freshen already installed packages. After the initial install, re-running npm install does not update existing packages since npm already finds satisfying versions installed on the file system. When you run npm install on a fresh project, npm installs the latest versions satisfying the semantic versioning ranges defined in your package.json. Updating to close-by version with npm update Here's the correct way to update dependencies using only npm from the command line. Semantic versioning screws things just enough, so it's safer to manually edit package.json than to attempt npm acrobatics. It's hard to update a new version of a library.
