Skip to content
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: Scoped package name not encoded #26385

Closed
marvinhagemeister opened this issue Oct 18, 2024 Discussed in #26384 · 3 comments · Fixed by #26390
Closed

Bug: Scoped package name not encoded #26385

marvinhagemeister opened this issue Oct 18, 2024 Discussed in #26384 · 3 comments · Fixed by #26390
Labels
bug Something isn't working correctly install

Comments

@marvinhagemeister
Copy link
Contributor

Discussed in #26384

Originally posted by idleberg October 18, 2024
Using Deno 2.0, I'm trying to install packages from a private NPM registry (AWS CodeArtifact). I don't think I missed anything from the documentation, but somehow, Deno is unable to find the packages.

Here is my .npmrc file:

# third-party packages will be consumed from npmjs.org
registry=https://registry.npmjs.org/

# private packages will be consumed from AWS CodeArtifact
@my-org:registry=https://my-registry.d.codeartifact.eu-central-1.amazonaws.com/npm/npm/
//my-registry.d.codeartifact.eu-central-1.amazonaws.com/npm/npm/:always-auth=true
//my-registry.d.codeartifact.eu-central-1.amazonaws.com/npm/npm/:_authToken=${CODEARTIFACT_AUTH_TOKEN}

And here the result when trying to run a script that has a dependency from that registry:

$ deno run -A build

error: Error getting response at https://my-registry.d.codeartifact.eu-central-1.amazonaws.com/npm/npm/@my-org/commitlint-config for package "@my-org/commitlint-config": Bad response: 400

{"success":false,"error":"Bad request. The package name '@my-org' is invalid."}

Additionally, I have tried several other things:

  • use DENO_NPM_REGISTRY, which I came across in this issue
  • create an import map that explicitly maps @my-org/commitlint-config to npm:@my-org/commitlint-org
  • the output of running the same command with -L debug doesn't seem to reveal anything useful, but I can post it if it helps

Since I did not find helpful answers on Google or in this repo, I'm reaching out to the community. Hopefully, someone can give me further clues about what I'm missing.

@marvinhagemeister
Copy link
Contributor Author

marvinhagemeister commented Oct 18, 2024

Looking into this it seems like we're not encoding scoped package names:

  • npm: @rollup/plugin-json -> https://registry.npmjs.org/@rollup%2fplugin-json
  • Deno: @rollup/plugin-json -> https://registry.npmjs.org/@rollup/plugin-json

It looks like the npm registry supports both the encoded and non-encoded form, but other registries likely don't.

@brenc
Copy link

brenc commented Oct 21, 2024

It looks like the npm registry supports both the encoded and non-encoded form, but other registries likely don't.

Just wanted to note that npm doesn't appear to like the non-encoded form either as I'm unable to install one of my private scoped packages (which is why I'm here).

@marvinhagemeister
Copy link
Contributor Author

The fix is not released yet, but you can try a canary build of Deno by running deno upgrade canary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly install
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants