Update Node.js and NPM

David Y.

The Problem

How do I update Node.js and NPM to the latest versions?

The Solution

Node.js

How you update Node.js will depend on how it was installed. If you’ve installed Node.js using a package manager, such as apt on Debian and Ubuntu or brew on MacOS, it will be automatically updated when a system upgrade is run. Otherwise, you may need to download a new version from the Node.js website.

The best way to manage different versions of Node.js is Node Version Manager (NVM). The NVM repo has detailed instructions for installing and using NVM on Linux and MacOS. For Windows, NVM on Windows is the best solution.

NPM

NPM can update itself. Run the following command:

npm update --global npm

Get Started With Sentry

Get actionable, code-level insights to resolve Node performance bottlenecks and errors.

  1. Create a free Sentry account

  2. Create a Node project and note your DSN

  3. Install the Sentry Node SDK

npm install @sentry/node
  1. Configure your DSN
const Sentry = require('@sentry/node'); Sentry.init({ dsn: 'https://<key>@sentry.io/<project>' });

Loved by over 4 million developers and more than 90,000 organizations worldwide, Sentry provides code-level observability to many of the world’s best-known companies like Disney, Peloton, Cloudflare, Eventbrite, Slack, Supercell, and Rockstar Games. Each month we process billions of exceptions from the most popular products on the internet.

Share on Twitter
Bookmark this page
Ask a questionJoin the discussion

Related Answers

A better experience for your users. An easier life for your developers.

    TwitterGitHubDribbbleLinkedinDiscord
© 2024 • Sentry is a registered Trademark
of Functional Software, Inc.