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/@
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.