-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] aliases don't work with scoped packages in private registries #6108
Comments
if I add a non-aliased version to the list in addition to having an aliased entry in package.json, It succeeds on two successive NPM installs. However, if I remove the non-aliased entry in package.json, it fails every time again after i clear the npm cache and delete node_modules |
We did find a workaround: Our private registry is hosted in GitLab - our original login only logged into the package registry endpoint. by adding in the Project level repository, it worked:
It feels like the way NPM is parsing the same scope differently in two cases, like an entry for
is parsed differently than
where the former call needs metadata from GitLab from the project itself? I'm not sure why, though, since the packages are published to the Registry, which is a different API than the project one. |
I have the same problem |
Aliases don't work not only for scoped packages, in my situation it's a regular one. |
I have had same problem |
Ran into this problem where we were trying to alias a private package. The issue turned out that we needed to make sure to prefix the alias with the private registry prefix, otherwise the pipelines were failing to install. ie. "@scope/alias_name": "npm:@scope/private-package@1.2.3" |
I have a similar issue. We need to fix it |
hit the same workaround works but it's should be fixed. |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Related to #2884 :
Unfortunately I don't remember what workaround I used last time, but it appears I've run into the same issue, both on NPM 8.19 and NPM 9.4.
in package.json, I have:
and when I run
npm i
, I still am getting a 404strangely enough, if I remove the aliased reference in the package.json it installs with no issue. Then, if I then put the alias back into the package.json, there no longer is an error when I run npm install (or npm ci)
Expected Behavior
npm install can resolve the alias and the scope in the private registry
Steps To Reproduce
.npmrc:
rm -r node_modules
npm i
Environment
The text was updated successfully, but these errors were encountered: