-
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
Support --registry flag from CLI commands #792
Comments
use |
Having a CLI flag for this is a bad idea. Imagine if you forget the registry flag and publish an internal package to the public registry. I would instead recommend Yarn support the |
It always happens if people are careless even if they use something like And using |
It is necessary for network environment of China. |
yarn should support everything npm does, full stop - |
Has there been any update on this since October? |
You can add an .npmrc file? |
Sure. .npmrc
.yarnrc
package.json {
"name": "yarn-issue",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"foo": "0.0.0"
},
"publishConfig": {
"registry": "http://registry/b"
},
"author": "",
"license": "ISC"
} Here both Yarn and npm will try to fetch foo from registry/a, however only npm will consider the publishConfig and try to publish on registry/b. |
Ah, yarn doesn't respect |
Just send a PR for --registry, FYI though that config.getOption('registry') is used in multiple places |
Any news here? |
We received no pull requests, and our attention was focused on other features, so no. |
So currently there is no way to publish package in repo different from one defined in .npmrc or .yarnrc? |
@Eladriell have you found any workaround? |
You can use env variables.
|
yep that works. anyway, I'm on it. |
implements yarnpkg#792 - addresses a command line flag --registry to specify a registry that overides yarn/npm configuration for installing dependencies
would be happy to get some review and feedback on #4238 |
@bestander @arcanis can I get some ❤️ on the PR? :-) |
**Summary** implements #792 - addresses a command line flag --registry to specify a registry that overides yarn/npm configuration for installing dependencies. **Test plan** Added new tests.
I can confirm
Is there a way to achieve the same with yarn without having to use a .npmrc/.yarnrc file? |
@pschmoek thanks. I haven't explored If you use the YARN_REGISTRY environment variable will it work? |
@lirantal no it does not. A scopes registry is different to the 'global' registry. If you were to publish The funny thing though, configuring a scopes registry via npm config file works fine. Inside .npmrc
Having multiple registry instances to support, makes the .npmrc solution a pain to work with. |
I'll close this issue, as the original feature is now implemented - can you open a separate issue for the scope thing? Thanks! 😄 |
@pschmoek open the ticket and I will take a look later, maybe it's a small fix in the |
**Summary** implements yarnpkg#792 - addresses a command line flag --registry to specify a registry that overides yarn/npm configuration for installing dependencies. **Test plan** Added new tests.
Do you want to request a feature or report a bug?
yes, feature
What is the current behavior?
Only global config is available for setting registry
What is the expected behavior?
yarg add/install --registry https://custom.registry works
Please mention your node.js, yarn and operating system version.
Node. 6.4.0
macOS. 10.11
yarn. 0.15.1
The text was updated successfully, but these errors were encountered: