npm无法访问私人仓库,但浏览器可以访问

时间:2017-04-19 16:19:52

标签: java node.js maven npm

我们有公司私人回购密码。使用浏览器我可以轻松获取文件:http://nexus.xxx.com/repository/npm-public/del/-/del-2.2.2.tgz然后我有一个基本的auth弹出窗口,我输入用户名和密码,我可以下载npm包

但是当我使用npm(通过com.github.eirslett:frontend-maven-plugin:1.3)时,它会冻结一段时间,然后报告错误:

[ERROR] npm ERR! fetch failed http://nexus.xxx.com/repository/npm-public/del/-/del-2.2.2.tgz
[WARNING] npm WARN retry will retry, error on last attempt: Error: socket hang up
[ERROR] npm ERR! fetch failed http://nexus.xxx.com/repository/npm-public/del/-/del-2.2.2.tgz
[WARNING] npm WARN retry will retry, error on last attempt: Error: socket hang up
[ERROR] npm ERR! fetch failed http://nexus.xxx.com/repository/npm-public/del/-/del-2.2.2.tgz
[ERROR] npm ERR! Linux 4.4.0-72-generic
[ERROR] npm ERR! argv "/home/xxx/target/node/node" "/home/xxx/target/node/node_modules/npm/bin/npm-cli.js" "install"
[ERROR] npm ERR! node v4.2.6
[ERROR] npm ERR! npm  v3.10.10
[ERROR] npm ERR! code ECONNRESET
[ERROR] 
[ERROR] npm ERR! network socket hang up
[ERROR] npm ERR! network This is most likely not a problem with npm itself
[ERROR] npm ERR! network and is related to network connectivity.
[ERROR] npm ERR! network In most cases you are behind a proxy or have bad network settings.
[ERROR] npm ERR! network 
[ERROR] npm ERR! network If you are behind a proxy, please make sure that the
[ERROR] npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
[ERROR] 
[ERROR] npm ERR! Please include the following file with any support request:
[ERROR] npm ERR!     /home/xxx/npm-debug.log

在setting.xml中我有用户名和密码,但我想由于某种原因frontend-maven-plugin,因此npm无法接收它们。我该如何解决?

0 个答案:

没有答案