Installing private dependencies via npm in a VS Team Services CI build

前端 未结 2 1217
北恋
北恋 2021-01-28 18:39

I\'m setting up some CI builds of NodeJS projects in VS Team Services. I currently have four projects being cloned from private Github repositories, running npm install

2条回答
  •  花落未央
    2021-01-28 19:23

    The problem is that the build agent will not able to authenticate because of lack of SSH keys on the build agent and because the host verification will fail anyway.

    Instead you should create a Personal Access Token on GitHub with 'repo' only scope, then you should use it on your packages.json file (notice that ssh is replaced with https protocol):

    "project-name": "git+https://:@github.com/my-org/project-name.git#master",
    

提交回复
热议问题