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

deno run with npm specifier should resolve scopes in deno.json #24276

Closed
sant123 opened this issue Jun 19, 2024 · 4 comments
Closed

deno run with npm specifier should resolve scopes in deno.json #24276

sant123 opened this issue Jun 19, 2024 · 4 comments

Comments

@sant123
Copy link

sant123 commented Jun 19, 2024

Hi, I'm not sure if this is currently possible but take a look on this script:

deno run --allow-read --allow-env --allow-sys npm:@swc/cli/swc compile-me.ts

The @swc/cli module has a peer dependency to @swc/core, currently is resolving the latest version and is fine for me.

However in the case I should need a different @swc/core version how can I do it?

I have tried this in my deno.json:

{
  "scopes": {
    "@swc/cli/swc": {
      "@swc/core": "npm:@swc/[email protected]"
    }
  }
}

But still resolves the latest version @swc/[email protected], not @swc/[email protected].

In case you need it, this is the content of compile-me.ts file:

export function add(a: number, b: number) {
    return a + b;
}

Thanks.

@dsherret
Copy link
Member

I think #18191 would cover this?

@dsherret
Copy link
Member

FWIW, you can hackily force this behaviour at the moment by modifying a lockfile.

@sant123
Copy link
Author

sant123 commented Jun 20, 2024

Ohh there is an issue already, @dsherret how can I do it with the lockfile? However the deno.json file has lock: false so there is no deno.lock in my directory.

@lucacasonato
Copy link
Member

Closing as dupe of #18191

But hopefully @dsherret can respond regardless 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants