-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Yarn not authenticating when "npm:" alias version points to authenticated package #8130
Comments
I did some console.log debugging in my test case. see: https://github.com/yarnpkg/yarn/blob/master/src/registries/npm-registry.js#L165
It gets into the first |
Seeing the same thing here. Is there a known workaround? |
We found the following workaround:
With this, yarn seems to download |
It was pretty annoying to apply the modification to multi-level dependencies, but it's better than non-working aliases :) I confirm that the workaround proposed by @tinydylan fixes the issue. |
Closing as fixed in v2 |
Thank you @tinydylan. However, for me at least, an alternative solution (provided by @austin-rausch) was much more appropriate – I am using package aliases to import multiple versions of the same package. |
There's plenty of people sill using [email protected] - this should be fixed imo. Just ran into this issue and spent half a day trying to figure out what was causing it. |
Bug description
Yarn is not using authentication when an aliased dependency points to a package that requires authentication.
I'm using an aliased package in my package.json, like this:
@rtc/tinymce
is a package that requires authentication. However, yarn does not appear to be sending any authentication.It works fine if I use a normal dependency like this:
In both scenarios, I have a
.yarnrc
file:and I have the relevant auth token in
~/.npmrc
.Command
With the above package.json, I run:
yarn install rm -rf node_modules yarn cache clean --pattern '@rtc/*' yarn install --frozen-lockfile
What is the current behavior?
Yarn is not sending authentication when I run
yarn install --frozen-lockfile
. This is causing a 401 error.What is the expected behavior?
The authentication is sent through correctly.
Steps to Reproduce
Unfortunately, I'm unable to provide a public replication case - by nature, this requires an authenticated service. I've been testing with CloudSmith as an example.
package.json
.yarnrc
and~/.npmrc
as described above.Environment
13.12.0
1.22.4
Also tested on:
10.20.1
1.22.4
The text was updated successfully, but these errors were encountered: