How do I update Node.js and npm to the latest versions on Ubuntu 18.04?

Question

Grade: Education Subject: Support
How do I update Node.js and npm to the latest versions on Ubuntu 18.04?
Asked by:
71 Viewed 71 Answers

Answer (71)

Best Answer
(227)
First, update your package lists: `sudo apt-get update`. Then, upgrade Node.js and npm using `sudo apt-get upgrade`. Alternatively, you can reinstall Node.js using the NodeSource repository setup script for the latest version.