wget https://npm.taobao.org/mirrors/node/v10.16.0/node-v10.16.0-linux-x64.tar.gz #针对 x86_64架构
# wget https://npm.taobao.org/mirrors/node/v10.16.0/node-v10.16.0-linux-arm64.tar.gz #针对 arm64架构
tar -xvf node-v10.16.0-linux-x64.tar.gz
mv node-v10.16.0-linux-x64 /opt/nodejs
ln -s /opt/nodejs/bin/npm /usr/local/bin/
ln -s /opt/nodejs/bin/node /usr/local/bin/
ln -s /opt/nodejs/bin/npx /usr/local/bin/
cat <<EOM >>/etc/profile
#npm
export PATH="/opt/nodejs/bin:$PATH"
EOM
source /etc/profile
wget https://npm.taobao.org/mirrors/node/v10.16.0/node-v10.16.0.tar.gz
tar xvf node-v10.16.0.tar.gz
cd node-v10.16.0/
./configure
make #这个操作可能会很久
make install
npm -v #查看版本
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm -v
npm install --registry=https://registry.npm.taobao.org
npm config set registry https://registry.npm.taobao.org
npm config get registry
#或
npm info express