-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Private registry / Configure npm registry for module download #16105
Comments
I think it is necessary. I want to pay attention to this progress, because in China, I sometimes download the resources of npm very slowly. |
+1 this is a basic requirement for enterprise use |
Good to have GitLab private package registry support 🚀 |
It looks like this is currently possible through the
It'd be great if this was possible to set via a configuration property in |
Related to: denoland/deno#16105 I think there is probably more work to do to flesh out support for private registries (e.g would be great to formalize things like [auth configuration](https://docs.npmjs.com/cli/v9/configuring-npm/npmrc#auth-related-configuration)) but this at least documents a way to start integrating with a private registry.
Related to: denoland/deno#16105 I think there is probably more work to do to flesh out support for private registries (e.g would be great to formalize things like [auth configuration](https://docs.npmjs.com/cli/v9/configuring-npm/npmrc#auth-related-configuration)) but this at least documents a way to start integrating with a private registry.
Related to: denoland/deno#16105 I think there is probably more work to do to flesh out support for private registries (e.g would be great to formalize things like [auth configuration](https://docs.npmjs.com/cli/v9/configuring-npm/npmrc#auth-related-configuration)) but this at least documents a way to start integrating with a private registry.
Sorry, the |
@dsherret thanks for clarifying that and a adding that warning 😄 Is this issue the best place for community feedback to try and help shape that work? As @jimisaacs mentioned, I think this is crucial in bringing the magic of |
We're going to discuss this issue tomorrow in our weekly meeting. For now I'm not adding the warning because the environment variable is used in all our tests in order to use a test npm registry, but consider it unstable. |
Probably we should just use the same env var as NPM: |
In the meantime, we can dual-write to both variables to make a transition easier. |
I opened #16980 for NPM_CONFIG_REGISTRY support. We'll look into support for different registries for scopes and credentials in the future. |
#16980 got merged, should this issue be closed? |
So how to set NPM_CONFIG_REGISTRY? |
Like you would normally set environment variables. Google may help you with this if you do not know how to do it already. |
Ideally deno should support parsing per-scope registry and per-registry auth tokens from the npmrc files and corsponding env vars, so that users can use multiple registries and tokens. |
It's mentioned in a comment above: #16105 (comment) |
Is there any update on this @dsherret? This is a big blocker for many use cases. |
The |
Where I work, there are some Node microservices that could benefit from migrating to Deno. However, these microservices depend on private Gitlab NPM packages. This feature is blocking the upgrade to Deno because many of these private packages are critical to these services and cannot run without them. The work so far on this has been excellent and I've not reported any other issues. I will just have to wait until Deno supports private packages before upgrading. |
Implementing this as a Configuration file option ( |
Hi, how is possible to setup a private registry with this environment variable? I'm using gemfury as registry, and I've tried below command without success:
I get this error:
I usually use gemfury with yarn on node and it works nicely, below my
and finally here is
|
@esnho The env was changed to |
For Github private registries, we use local-directory
Developers have this env var set to a valid token. For Codeartifact private regsitries, we use the (For adopting Deno, as long as we can globally define the auth token for all repos somewhere, and locally or globally set a scope for the registry, we can figure out a migration path) |
Hi, for Azure Artifacts npm - user level .npmrc with the authToken is desired, see https://learn.microsoft.com/en-us/azure/devops/artifacts/get-started-npm?view=azure-devops&tabs=Other I think this is common scenario for npm scoped registry settings - committed .npmrc with scope and registry URL, then $HOME/.npmrc with authToken for this registry. |
@bartlomieju I also wanted to add that this is critical for using Deno within my company, as we have multiple internal proxied NPM repositories (including a copy of NPM, as well as Sonatype Nexus 3.65.x). Do you have any ETA for when you'd like to try to land this in a release? I'd like to volunteer to test. Local .npmrc compatibility would be incredible with our URLs/auth specified like: @dcl-crew:registry=https://nexus3.disney.com/repository/npm/ |
This commit adds initial support for ".npmrc" files. Currently we only discover ".npmrc" files next to "package.json" files and discovering these files in user home dir is left for a follow up. This pass supports "_authToken" and "_auth" configuration for providing authentication. LSP support has been left for a follow up PR. Towards #16105
@jtibble this fubctionality should now available in canary. Please try it out and let me know. |
@bartlomieju I tested this in a node project running node 20 and vite. Deno canary version: I placed the
If i run
Installing and running via npm works fine. I hope this helps. |
@gengurke please do |
@bartlomieju Thanks! It worked like a charm and behaved just like using npm. The only difference was that I had to place the |
@bartlomieju I also validated with canary build deno 1.43.6+8b5089e (canary, aarch64-apple-darwin) and it worked like a charm! 🙌 SO excited to have this working locally. What a dream! I have both my registry and auth in my local directory .npmrc like this: registry=https://nexus3.disney.com/repository/npm/ so my only request now is to allow for joining .npmrcs, so I can keep my auth token separate. Not a big deal either way, because we can just .gitignore this, but yes, thanks again! So excited to see this land in the main build! |
@bartlomieju Is there any chance the .npmrc functionality currently in the canary builds could be added to the 1.44 release milestone? Even behind a feature flag or toggle would be great, so we can at least start using it on my development team. Thanks! |
@jtibble, yes this functionality will be in v1.44 and will be announced in a blog post. I will try to get merging of |
@bartlomieju I also wanted to bring to your attention that in VSCode, with the Deno language server extension, even with the checkbox enabled for Deno: Future, the private-registry-module-resolution is not resolving. This is with canary build 1.43.6+a89253. I tried caching through the VSCode popup, no luck. Manually caching the dependency in the terminal works, but still the VSCode extension can't resolve it. Screenshots: |
Worked well with Deno version: 1.43.6+3c3076a
|
Support for private registries/ There are a few remaining features that need to be addressed:
Overall, I think we can now close this issue. Please subscribe to relevant issue or open new ones if you experience any problems. |
Hi everyone, we discovered an issue in .npmrc support in Deno 1.44.0 where Deno would send npmrc credentials for the scope to the tarball URL when the registry provided URLs for a tarball on a different domain. For example, the npm registry provides information on a package at a url like this: https://registry.npmjs.org/code-block-writer -- you can see that under You can read more about this here: https://github.com/npm/cli/wiki/%22No-auth-for-URI,-but-auth-present-for-scoped-registry%22 (how Deno is working is actually how npm used to behave) I recommend to stop using .npmrc support in Deno 1.44.0 and if your private registry ever serves tarballs at a different domain to rotate your registry credentials. We have a fix for this here: #24111 and are going to do a release in a few hours to fix this issue. Huge apologies on this one. |
1.44.1 has been released. Please upgrade ( A security advisory for 1.44.0 was published here: GHSA-rfc6-h225-3vxv |
I would like to be able to use a custom, self-hosted npm registry.
Especially for resolving company-local private packages based on scopes this would be very helpful.
As far as I can see, currently only the npm public registry (https://registry.npmjs.org/) can be used.
Deno should support something similar to npm's configuration:
The text was updated successfully, but these errors were encountered: