我能够在Teamcity中添加vcs root并测试连接,连接成功。 但是我收到了验证失败的错误。请指教。
Step 1/1: Install npm packages (Node.js NPM) (3s)
[00:00:00][Step 1/2] Executing npm via wrapping shell script
[00:00:00][Step 1/2] Starting: cmd /c npm install
[00:00:00][Step 1/2] in directory: F:\BuildAgent\work\abc13213
[00:00:00][Step 1/2] npm install (3s)
[00:00:00][npm install] npm ERR! git fetch -a origin (https://git@bitbucket.org/team/repo.git) remote: Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your account profile.
[00:00:00][npm install] npm ERR! git fetch -a origin (https://git@bitbucket.org/team/repo.git) fatal: Authentication failed for 'https://git@bitbucket.org/team/repo.git/';
[00:00:00][npm install] npm ERR! Windows_NT 6.3.9600
[00:00:00][npm install] npm ERR! argv "F:\\nodejs\\node.exe" "C:\\Users\\svc-p-teamcity\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
[00:00:00][npm install] npm ERR! node v6.10.2
[00:00:00][npm install] npm ERR! npm v4.3.0
[00:00:00][npm install] npm ERR! code 128
[00:00:00][npm install]
[00:00:00][npm install] npm ERR! Command failed: git -c core.longpaths=true fetch -a origin
[00:00:00][npm install] npm ERR! remote: Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your account profile.
[00:00:00][npm install] npm ERR! fatal: Authentication failed for 'https://git@bitbucket.org/team/repo.git/';
[00:00:00][npm install] npm ERR!
[00:00:00][npm install] npm ERR!
[00:00:00][npm install] npm ERR! If you need help, you may report this error at:
[00:00:00][npm install] npm ERR! <https://github.com/npm/npm/issues>;
[00:00:00][npm install]
[00:00:00][npm install] npm ERR! Please include the following file with any support request:
[00:00:00][npm install] npm ERR! C:\Users\user\AppData\Roaming\npm-cache\_logs\2017-06-05T19_50_00_082Z-debug.log
[00:00:00][Step 1/2] Process exited with code 1
[00:00:00][Step 1/2] Step Install npm packages (Node.js NPM) failed
答案 0 :(得分:0)
您在Teamcity中配置了VCS root,因此在构建开始之前,Teamcity将自动检出本地计算机所需的存储库路径。
您在原始日志中显示的问题是不同的:npm正在尝试连接到bitbucket存储库以安装某些依赖项并因为授权而失败。
要解决此问题,对于Teamcity用户(user
,您必须configure SSH key,从我的日志中可以看到)。您可以通过从Teamcity代理所在的原始主机运行相同的命令来验证它是否有效:
git clone 'https://git@bitbucket.org/team/repo.git/'
否则,您必须更改依赖项的来源:也许您在某处有一个Artifactory实例,不需要授权。