Linux下安装部署Node

13 篇文章 0 订阅

系统:CentOS Linux release 7.7.1908 (Core)

软件:node-v14.16.0

安装步骤

mkdir -p /usr/local/soft/package
cd /usr/local/soft/package
#下载安装包,解压
wget https://repo.huaweicloud.com/nodejs/latest-v14.x/node-v14.16.0-linux-x64.tar.xz
tar -xvf node-v14.16.0-linux-x64.tar.xz
mv node-v14.16.0-linux-x64 ../node

#创建软连接
ln -s /usr/local/soft/node/bin/npm /usr/local/bin/npm
ln -s /usr/local/soft/node/bin/node /usr/local/bin/node

npm源配置

#配置淘宝源
npm config set registry https://registry.npm.taobao.org/
#执行下面的命令,确认是否切换成功。
npm config get registry
#原始npm源是 发公共包的时候要用
#npm config set registry https://registry.npmjs.org/

其它工具

#yarn
npm install -g yarn --registry=https://registry.npm.taobao.org
ln -s /usr/local/soft/node/bin/yarn /usr/local/bin/yarn
yarn config set registry https://registry.npm.taobao.org
yarn --version

#cnpm
npm install -g cnpm -–registry=https://registry.npm.taobao.org
ln -s /usr/local/soft/node/bin/cnpm /usr/local/bin/cnpm
cnpm --version

#npm install 如果提示权限不足 在后面添加--unsafe-perm参数
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值