【如何在Jenkins的从节点切换NPM镜像源查看和切换】

【问题】

Jenkins打包时,前端npm构建时很慢,所有需要更换镜像源

【自查】

找到Jenkins从节点上的nodejs安装的路径,进入bin目录

复制代码
执行./npm -v查看是不能正常查看,
[root@localhost bin]# ./npm -v
/usr/bin/env: 'node': No such file or directory

#进入nodejs的bin后,当前目录编辑npm
vi npm
修改node前加./后保存,就可以在当前目录查询

【切换npm】

复制代码
//查看镜像源使用状态:
./npm get registry
//全局切换镜像源(如果公司有自己的镜像源,则在registry后加自己的):
./npm config set registry http://registry.npm.taobao.org
//全局切换官方镜像源
npm config set registry https://registry.npmjs.org/
相关推荐
码农101号几秒前
Linux中shell编程表达式和数组讲解
linux·运维·服务器
powerfulzyh13 分钟前
非Root用户启动SSH服务经验小结
运维·ssh
云道轩22 分钟前
升级centos 7.9内核到 5.4.x
linux·运维·centos
爱学习的小道长36 分钟前
Ubuntu Cursor升级成v1.0
linux·运维·ubuntu
EelBarb42 分钟前
seafile:ubuntu搭建社区版seafile12.0
linux·运维·ubuntu
402 Payment Required1 小时前
serv00 ssh登录保活脚本-邮件通知版
运维·chrome·ssh
小柏ぁ1 小时前
calico/node is not ready: BIRD is not ready: BGP not established with xxx
运维·docker·kubernetes
Mintimate1 小时前
云服务器 Linux 手动 DD 安装第三方 Linux 发行版:原理与实战
linux·运维·服务器
RussellFans2 小时前
Linux 环境配置
linux·运维·服务器
三劫散仙2 小时前
kubernetes jenkins pipeline优化拉取大仓库性能指定分支+深度
容器·kubernetes·jenkins