下载适配的node版本
本篇文章主要解决:node版本兼容特定glibc版本的问题
下载适配的node版本,兼容glibc_217
下载地址:
wget https://unofficial-builds.nodejs.org/download/release/v18.18.1/node-v18.18.1-linux-x64-glibc-217.tar.gz
然后运行下面命令:
tar -xvf node-v18.18.1-linux-x64-glibc-217.tar.gz
cd node-v18.18.1-linux-x64-glibc-217
1. Set Taobao Mirror as npm Registry
Change the default npm registry to Taobao's mirror:
Command:
npm config set registry https://registry.npmmirror.com
Verify the change:
npm config get registry
You should see:
https://registry.npmmirror.com
2. Clear npm Cache
If the previous download attempts were slow, clear the npm cache to start fresh:
npm cache clean --force
3. Install Dependencies Again
Run npm install
again:
npm install
4. Use cnpm
(Optional)
cnpm is a faster npm client for users in China. Install it globally:
npm install -g cnpm --registry=https://registry.npmmirror.com
Then use cnpm
to install dependencies:
cnpm install
5. Use pnpm
for Faster Installations
Switch to pnpm, a faster package manager that works well with large dependency trees.
Install pnpm:
npm install -g pnpm
Use pnpm to Install:
pnpm install