Github actions, 401 unauthorized when installing a Github Package with npm or yarn

后端 未结 1 1867
终归单人心
终归单人心 2020-12-17 04:05

When I try to install my npm modules from a GitHub action I get the following error:

npm ERR! 401 Unauthorized - GET https://npm.pkg.github.com/@         


        
相关标签:
1条回答
  • 2020-12-17 04:20

    I ended up having to contact GitHub support and give them access to my repo to figure this out.

    However they did figure out what the problem was.

    Github workflows are more strict than local environments and requite an extra / before the auth token:

    spot the difference:

    //npm.pkg.github.com:_authToken=XXXXXXXXX
    //npm.pkg.github.com/:_authToken=XXXXXXXXX
    

    adding the extra / before :_authToken= solved the issue for me.

    0 讨论(0)
提交回复
热议问题