Linux安装nodejs

cd /opt/soft

wget https://cdn.npmmirror.com/binaries/node/v16.15.1/node-v16.15.1-linux-x64.tar.xz

tar -xvf node-v16.15.1-linux-x64.tar.xz

mv node-v16.15.1-linux-x64 nodejs-v16.15


#建立软连接

ln -s /opt/soft/nodejs-v16.15/bin/node /usr/bin/node

ln -s /opt/soft/nodejs-v16.15/bin/npm /usr/bin/npm


#查看是否安装成功
root@pc:/opt/soft# node -v
v16.15.1

#设置淘宝源
npm config set registry https://registry.npm.taobao.org

#查看是否修改成功
npm config get registry

#==================== 安装pnpm ===================
#1.获取脚本执行脚本
wget -qO- https://get.pnpm.io/install.sh | sh -

#2.使变量生效
source /root/.bashrc


//查看源
pnpm config get registry 
//切换淘宝源
pnpm config set registry https://registry.npmmirror.com/

posted @   Cool_Yang  阅读(41)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
历史上的今天:
2019-06-15 Java中堆区 | 栈区 | 方法区
点击右上角即可分享
微信分享提示