How to install Node.js and NPM
Links:
Get Node.js and NPM (always installed together):
- Debian / Ubuntu - based on Node docs.
- Optional step - set up a target Node version such as v14. If you skip, this you'll get the stable version for your OS, such might be say v12 or v10.
$ curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - $ sudo apt update
- Install Node using APT.
$ sudo apt install nodejs
- Optional step - set up a target Node version such as v14. If you skip, this you'll get the stable version for your OS, such might be say v12 or v10.
- Red Hat / Fedora / CentOS
- See instructions for adding a repository to install from.
- macOS - use a Brew formula.
$ brew install node
- Windows
- Download and run the Windows installer from the Node.js Download page.
- Other systems
- Follow the package manager instructions on the Node.js website.
If you prefer, you can install Node.js by installing and using NVM - see gist.
Check installed versions:
- Node.js
$ node --version v14.2.0
- NPM
$ npm --version 6.14.4
Use your package manager to update to newer versions of Node.
If you need to upgrade just NPM, use NPM like this:
$ npm install -g npm
To start using NVM, see this Install Node with NVM gist.