【发布时间】:2019-06-24 19:09:15
【问题描述】:
尝试安装远程包失败,状态码为 401,
npm/git 不提示输入 gitlab 凭据
我试过这两个:
git config --unset credential.helper
git config --global --unset credential.helper
他们都没有改变任何东西
命令:
$ npm install http://gitlab.blabla.com/bla
npm ERR! fetch failed http://gitlab.blabla.com/bla
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 401
npm ERR! fetch failed http://gitlab.blabla.com/bla
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 401
npm ERR! fetch failed http://gitlab.blabla.com/bla
npm ERR! Linux 4.15.0-43-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "http://gitlab.blabla.com/bla"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! fetch failed with status code 401
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! /home/bla/test/npm-debug.log
我希望 npm 提示我输入远程访问凭据,但什么也没有。
如何解决这个提示问题?
编辑:SSH 身份验证不是一个选项。
编辑 2:在 URL 中添加凭据不起作用:相同的输出。
【问题讨论】: