Node.js Jenkins-NPM更新失败

Node.js Jenkins-NPM更新失败,node.js,jenkins,npm,build,Node.js,Jenkins,Npm,Build,在jenkins中构建代码时,我在NPM更新方面遇到了一些错误 package.json文件中的所有依赖项都已存在于私有repo中 Running npm update in /var/www-etc/etc/releases/source/2018012599999 npm ERR! Linux 3.13.0-139-generic npm ERR! argv "/var/www-etc/.nvm/versions/node/v4.2.2/bin/node" "/var/www-notif

在jenkins中构建代码时,我在NPM更新方面遇到了一些错误

package.json
文件中的所有依赖项都已存在于私有repo中

Running npm update in /var/www-etc/etc/releases/source/2018012599999

npm ERR! Linux 3.13.0-139-generic

npm ERR! argv "/var/www-etc/.nvm/versions/node/v4.2.2/bin/node" "/var/www-notify/.nvm/versions/node/v4.2.2/bin/npm" "update"

npm ERR! node v4.2.2
npm ERR! npm  v2.14.7
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/etc
npm ERR! 404 
npm ERR! 404 'etc' is not in the npm registry.

正如您所提到的,您使用私有回购,但错误表明您从公共回购获得依赖性:,我猜您的网络需要代理来访问公共网络,而您没有为npm设置代理

选项1)在npm命令行中指定npm注册表:
npm安装--registry=您的私有回购url

选项2)使用项目级.npmrc文件
1) 在nodejs项目文件夹(package.json所在的位置)下创建
.npmrc
文件
2) 在
.npmrc
文件中添加以下内容

registry = your private repo url
strict-ssl=false
// if need proxy to access private repo, comment out below two lines
// http-proxy = proxy address
// https-proxy= proxy address

Show your package.json,从给定的错误来看,您似乎有一个依赖项:
etc
,npm无法从
https://registry.npmjs.org