berry: [Bug] Registries with non-conventional tarball paths
Describe the bug
I am trying to setup yarn v2 but I have some custom registries. When i run yarn config -c
, and error is output saying that the key is not correct. From what i’ve seen here, the config looks correct.
I’ve tried using the yaml format for v2, but since my primary yarn command is v1, it seems necessary that the .yarnrc file is marked as v1.
To Reproduce
.yarnrc
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
npmScopes.org.npmRegistryServer "<url>"
yarn-path ".yarn/releases/yarn-berry.js"
enableGlobalCache true
Running yarn config -v
outputs the following:
YN0034: Invalid configuration key "npmScopes.org.npmRegistryServer" in ~/.yarnrc
Environment if relevant (please complete the following information):
- OS: MacOS 10.14.5
- Node version 8.15.0
- Yarn version 1.13.0 (with latest berry version installed from the readme instructions)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (5 by maintainers)
@paul-sachs, I want to say thank you. Your comments were invaluable in figuring out how to authenticate with Artifactory using Yarn Berry 🙂
For anyone else who is trying to get Yarn Berry working with Artifactory, your .yarnrc.yml file should look like this (unless your using scopes):
npmAlwaysAuth
must be set totrue
in order for your user to be truly authenticated. If this is not set, your user may be able to authenticate with the Artifactory server but then may have issues when trying to download a new version of a package that’s not already in the Artifactory cache.Yeah i’ll give it a shot. Just got pulled onto something else for today, so i’ll take a look at this sometime tomorrow. Thanks for all your help!
Alright, one more step up the ladder and one more blocker. I’ve fixed the login issue, had to use the artifactory provided
_auth
field withnpmAuthIdent
. That got me past the auth problem. Now it says it can’t find the package again, though now it says it’s trying to follow the following path:https://my-host.com/artifactory/api/npm/npm-virtual/@org/package/-/package-1.3.5.tgz
Looking at verbose output from npm proper, i believe the path it needs to try is actually:
https://my-host.com/artifactory/api/npm/npm-virtual/@org/package/-/@org/package-1.3.5.tgz
Notice the extra @org in the npm version.
Not sure where the resolution logic is for this one but npm install logic is still very much a black box to me.