You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Ubuntu系统中安装旧版本Node.js?指定安装Node v=14.8.0与npm v=6.14.8的方法

Install Node.js v14.8.0 & npm v6.14.8 on Ubuntu

Hey there! Let's walk through how to install Node.js v14.8.0 and its matching npm v6.14.8 on your Ubuntu system, replacing any newer versions you might have installed. This guide uses two common methods — pick the one that fits your workflow best.

nvm (Node Version Manager) is the most hassle-free way to switch between Node.js versions without messing up your system setup.

Step 1: Uninstall existing Node.js/npm (if installed)

First, let's remove any current Node.js and npm installations to avoid conflicts:

  • Uninstall the packages:
    sudo apt remove --purge nodejs npm
  • Clean up leftover dependencies and configuration files:
    sudo apt autoremove
    sudo rm -rf /usr/local/lib/node_modules /usr/local/bin/node /usr/local/bin/npm

Step 2: Install nvm dependencies

You'll need curl and git to set up nvm:
sudo apt update && sudo apt install curl git -y

Step 3: Install nvm

Run the official nvm installation script (this sets up nvm in your user profile):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

After running the script, restart your terminal or run this command to load nvm immediately:
source ~/.bashrc
(If you use zsh instead of bash, replace .bashrc with .zshrc)

Step 4: Install Node.js v14.8.0

Use nvm to install the specific version:
nvm install 14.8.0

This will automatically install the matching npm v6.14.8 along with Node.js.

Step 5: Set it as the default version

Make this the default Node.js version for all new terminal sessions:
nvm alias default 14.8.0

Step 6: Verify the installation

Check that everything worked:
node -v
You should see v14.8.0

npm -v
You should see 6.14.8

Method 2: Install binary package directly (No version manager)

If you don't want to use nvm, you can install the pre-built binary directly:

Step 1: Uninstall existing Node.js/npm (same as Method 1)

Follow Step 1 from Method 1 to remove any current installations.

Step 2: Download the Node.js 14.8.0 binary

Grab the 64-bit Linux binary package:
curl -O https://nodejs.org/dist/v14.8.0/node-v14.8.0-linux-x64.tar.xz

Step 3: Extract the package to system directory

Extract the files to /usr/local (this will make node/npm available system-wide):
sudo tar -xJf node-v14.8.0-linux-x64.tar.xz -C /usr/local --strip-components=1

Step 4: Verify the installation

Run the same check commands as before:
node -v → v14.8.0
npm -v → 6.14.8


If you run into any snags (like permission errors or version mismatches), feel free to ask for clarification — I'm here to help!

内容的提问来源于stack exchange,提问作者Milan jotva

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.30 04:12:39