I’ve created a private repository inside an organization and successfully published a package into Github Packages (it’s available on the packages section of the repository)
However I’m unable to install the package from the command line.
I followed the documentation in order to autenticate using my personal access token (with all the necessary permissions):
$ npm login --scope=@OWNER --registry=https://npm.pkg.github.com > Username: USERNAME > Password: TOKEN > Email: PUBLIC-EMAIL-ADDRESS
OWNER being the organization name. This works as expected and I can login without trouble, however I get a 401 error message when using the install command (exactly the same command available in the packages section):
npm install @ORGANIZATION-NAME/REPOSITORY-NAME@1.0.0
401 Unauthorized - GET https://npm.pkg.github.com/@ORGANIZATION-NAME%2FREPOSITORY-NAME
- Your request could not be authenticated by the GitHub Packages service.
Please ensure your access token is valid and has the appropriate scopes configured.
If I go to that same URL in the browser and I put again my username and Personal Access Token, it allows me access to it.
I don’t understand what I’m doing wrong, any suggestions?