node 安装

wget  https://nodejs.org/download/release/v12.1.0/node-v12.1.0-linux-x64.tar.gz -P  /opt/
tar xzvf /opt/node-v12.1.0-linux-x64.tar.gz   -C /usr/local/
mv /usr/local/node-v12.1.0-linux-x64/  /usr/local/node
cat >> /etc/profile  << EOF
export NODE_HOME=/usr/local/node
export PATH=\$PATH:\$NODE_HOME/bin:/opt/node_global/bin 
export NODE_PATH=\$NODE_HOME/lib/node_modules
EOF
source /etc/profile
npm -v
mkdir  -p /usr/local/node/etc/
mkdir /opt/node_global
mkdir /opt/node_cache
mkdir /usr/local/node/etc/
cat > /usr/local/node/etc/npmrc << EOF
registry=http://registry.npm.taobao.org/
prefix=/opt/node_global
cache=/opt/node_cache
EOF
npm get registry

nvm 安装

centos7

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
source  /root/.bashrc 
 nvm  --version
0.33.8

安装指定版本node

nvm install v12.18.2
 nvm install v16.14.2

使用指定版本node

nvm  use 12.18
npm config set registry https://registry.npm.taobao.org/
 npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass

npm install 报错

npm ERR!   The unauthenticated git protocol on port 9418 is no longer supported.

vue-element-admin

git  --version
git version 2.27.0
node --version
v12.18.2
 python --version
Python 3.8.11
 cat /root/.gitconfig 
[url "https://"]
        insteadOf = ssh://

[url "https://"]
        insteadOf = git://
rm -rf /opt/node_cache/*
npm install --registry=https://registry.npm.taobao.org

macos

npm --version
6.14.5
node --version
v12.18.2
 git --version
git version 2.32.0 (Apple Git-132)
 python --version
Python 2.7.18
git config --global url."https://".insteadOf git://
npm install --registry=https://registry.npm.taobao.org
npm run dev
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值