February 4, 2023

Package update commands

Commands

npm

1
2
3
4
5
6
# Check installed version
npm -v
# Or
npm --version
# Update
npm install -g npm@latest

Node.js

The best way to manage Node.js is using NVM (Node Version Manager).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
# Or
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

# Verify installation
command -v nvm

# Download, compile and install the latest release of node
# "node" is an alias for the latest version
nvm install node

# Install a specific version
nvm install 14.7.0
# The first version installed becomes the default. New shells will start with the default version of node

# List avaliable version
nvm ls-remote


Reference

About this Post

This post is written by Andy, licensed under CC BY-NC 4.0.

#Package Update