Categories
Development

Node.js WSL

Install Node.js on WSL

Install Node.js on Windows Subsystem for Linux (WSL2)

I am following this instructions: https://learn.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-wsl

Install Node Version Manager (nvm)

sudo apt-get install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash

## Open NEW TERMINAL windows

# test installation
command -v nvm
nvm


# check version
nvm ls

->       system
iojs -> N/A (default)
node -> stable (-> N/A) (default)
unstable -> N/A (default)


# check node version
node --version
v10.19.0

Install Node.js

# install LTS
nvm install --lts


# check version
nvm ls
->     v16.18.0
         system
default -> lts/* (-> v16.18.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v16.18.0) (default)
stable -> 16.18 (-> v16.18.0) (default)
lts/* -> lts/gallium (-> v16.18.0)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.20.1 (-> N/A)
lts/gallium -> v16.18.0


# check node version
node --version
v16.18.0


# check npm version
npm --version
8.19.2

Some npm commands

# Show installed Nodes
nvm ls
# Show available versions
nvm ls-remote
# Install latest version
nvm install node
# Install LTS version
nvm install --lts
# Install a specific version (list available -> example 16.18.0)
nvm install 16.18.0
# Use a specific version
nvm use 16.18.0
# Show npm version
npm --version

Categories
Development

Node.js

Install Node.js on Windows

I am following this instructions: https://docs.microsoft.com/de-de/windows/nodejs/setup-on-windows

Download Node Version Manager (nvm) for Windows: https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows
Current version: 1.1.7; nvm-setup.zip

Open cmd or GitBash and run ‘nvm ls’ to see installed Node versions.

Some npm commands:

# Show installed Nodes
nvm ls
# Show available versions
nvm list available
# Install latest version
nvm install latest
# Install latest LTS version (list available -> currently 12.19.0)
nvm install 12.19.0
# Use latest LTS version
nvm use 12.19.0
# Show npm version
npm --version