首页 > 解决方案 > npm install using proxy 报错

问题描述

您好 npm install 失败,如屏幕截图所示。我正在使用代理,在安装 npm 之前,我有

  1. 得到nodejs,Git下载并安装。git 版本是 2.17.0.windows.1
  2. 为代理和注册表运行 npm config set。获得在 C:\Users\user 中创建的 .npmrc 文件。任何帮助,将不胜感激。

请查找 npm 安装日志:

user@trsrall2060597 MINGW64 /c/xyzsite/trs-b2b-ui (develop)
$ npm install
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:204:12)
npm WARN addRemoteGit     at emitTwo (events.js:106:13)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:886:16)
npm WARN addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm WARN addRemoteGit  git+https://github.com/goutamsm/ng1-protractor.git resetting remote C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-goutamsm-ng1-protractor-git-8bb1045c because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:204:12)
npm WARN addRemoteGit     at emitTwo (events.js:106:13)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:886:16)
npm WARN addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm WARN addRemoteGit   killed: false,
npm WARN addRemoteGit   code: 1,
npm WARN addRemoteGit   signal: null,
npm WARN addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
npm ERR! git clone --template=C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/goutamsm/ng1-protractor.git C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-goutamsm-ng1-protractor-git-8bb1045c: Cloning into bare repository 'C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-goutamsm-ng1-protractor-git-8bb1045c'...
npm ERR! git clone --template=C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/goutamsm/ng1-protractor.git C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-goutamsm-ng1-protractor-git-8bb1045c: fatal: unable to access 'https://github.com/goutamsm/ng1-protractor.git/': Received HTTP code 407 from proxy after CONNECT
npm ERR! Windows_NT 10.0.16299
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code 128

npm ERR! Command failed: git -c core.longpaths=true clone --template=C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/goutamsm/ng1-protractor.git C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-goutamsm-ng1-protractor-git-8bb1045c
npm ERR! Cloning into bare repository 'C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-goutamsm-ng1-protractor-git-8bb1045c'...
npm ERR! fatal: unable to access 'https://github.com/goutamsm/ng1-protractor.git/': Received HTTP code 407 from proxy after CONNECT
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\xyzsite\trs-b2b-ui\npm-debug.log

标签: npm-install

解决方案


推荐阅读