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

Show hint when trying to install a package globally without a :npm/:jsr prefix #26545

Closed
dmint789 opened this issue Oct 25, 2024 · 3 comments · Fixed by #26629
Closed

Show hint when trying to install a package globally without a :npm/:jsr prefix #26545

dmint789 opened this issue Oct 25, 2024 · 3 comments · Fixed by #26629
Labels
bug Something isn't working correctly good first issue Good for newcomers

Comments

@dmint789
Copy link

When I try to install a package globally without specifying the source (e.g. deno install -g concurrently), it throws this error: 'error: Module not found "/path/to/current/dir/package_name"'. Instead, it should show the same type of hint as deno add [package without a source specifier] (e.g. error: concurrently is missing a prefix. Did you mean deno add npm:concurrently?).

@bartlomieju
Copy link
Member

Good idea, it's a "Good first issue" if someone is interested in implementing it. You can start by looking at install_global function in cli/tools/installer.rs and following what install_local is doing to figure out if a prefix should be added.

@bartlomieju bartlomieju added bug Something isn't working correctly good first issue Good for newcomers labels Oct 26, 2024
@SatanshuMishra
Copy link

This would be my first PR but I am happy to give it a try if that's alright!

@bartlomieju
Copy link
Member

@SatanshuMishra please do

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 good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants