Read several threads here in SO but haven't found the exact some type of issue. I'm having trouble trying to install a private package from my company (hosted on GitLab). The strangest thing is that I've already made it for the same repo, but inside vagrant. On vagrant, after having receiving the following error on a npm install:
ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@company-name%2foauth20-provider - Not found
npm ERR! 404
npm ERR! 404 '@company-name/oauth20-provider@0.8.0' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'project-srv'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\João~1\AppData\Roaming\npm-cache\_logs\2022-02-06T14_38_17_991Z-debug.log
I solved it by following these steps:
1 - Generate a new personal access token on GitLab (scope API): https://gitlab.com/-/profile/personal_access_tokens
2 - Run commands:
npm config set @company-name:registry https://gitlab.com/api/v4/projects/project-id/packages/npm/
npm config set -- '//gitlab.com/api/v4/projects/project-id/packages/npm/:_authToken' "<my-personal-access-token>"
When I try to run npm install outside of vagrant (in the same folder or another clone of the repo), it still gives the 404 error above. The thing is, I'm certain the steps I've tried are valid, since they work inside vagrant. What can possibly change by trying to do npm install outside of vagrant? I believe that it can possibly have to do with the OS, since I'm using the Laravel Homestead vagrant box (i.e. Ubuntu 20.04), and I'm running it on a Windows 10 machine.