Installing Node.js on Linux (Deepin V20+)

Node.js download page: https://nodejs.org/en/download/package-manager

Method 1: Manual Installation via Archive

After downloading the appropriate package from the link above, extract it to /env/nodejs (adjust the path as needed).

  • Create symbolic links
sudo ln -s /env/nodejs/node-v16.18.0-linux-x64/bin/npm /usr/local/bin/
sudo ln -s /env/nodejs/node-v16.18.0-linux-x64/bin/node /usr/local/bin/
  • Set mirror registry
npm config set registry https://registry.npmmirror.com/
  • Verify registry
npm config get registry
  • Install cnpm
npm install -g cnpm --registry=https://registry.npmmirror.com/
  • Create symlink for cnpm
sudo ln -s /env/nodejs/node-v16.18.0-linux-x64/bin/cnpm /usr/local/bin/

Method 2: Using nvm

# Install nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

# Download and install Node.js (you may need to restart the terminal)
nvm install 20

# Verify versions
node -v   # should output `v20.15.1`
npm -v    # should output `10.7.0`

Useful comamnds:

  • nvm list — List installed versions
  • nvm list installed — List installed versions
  • nvm list available — List available versions
  • nvm version — Show current nvm version
  • nvm install — Install latest version
  • nvm use <version> — Switch to a specific version
  • nvm ls — List all versions
  • nvm current — Show current active version
  • nvm alias <name> <version> — Set an alias
  • nvm unalias <name> — Remove an alias
  • nvm reinstall-packages <version> — Reinstall global packages for a version
  • nvm on — Enable Node.js version management
  • nvm off — Disable Node.js version management
  • nvm proxy — View or set proxy
  • nvm node_mirror <url> — Set or view Node.js mirror
  • nvm npm_mirror <url> — Set or view npm mirrror
  • nvm uninstall <version> — Uninstall a version
  • nvm use [version] [arch] — Use a version with optional architecture
  • nvm root [path] — Set or view root path

Method 3: Using fnm

# Install fnm (Fast Node Manager)
curl -fsSL https://fnm.vercel.app/install | bash

# Download and install Node.js
fnm use --install-if-missing 20

# Verify versions
node -v   # should output `v20.15.1`
npm -v    # should output `10.7.0`

Useful commands:

  • fnm install <version> — Install a specific version
  • fnm install --lts — Install LTS version
  • fnm uninstall <version> — Uninstall a version
  • fnm uninstall <alias> — Uninstall an aliased version
  • fnm use <version|alias> — Use a specific version
  • fnm alias <name> <version> — Set a alias
  • fnm unalias <name> — Remove an alias
  • fnm default <version> — Set the default version

Tags: Node.js Linux installation nvm fnm

Posted on Wed, 02 Sep 2026 16:47:03 +0000 by phpnewbie8