fix(cli): add prefix hint when installing a package globally
closes #26545
Shows a hint when a package is installed globally, otherwise fallbacks to the existing implementation.
Thanks for the PR @mbrdg, is there any chance you could add a test for this change?
Rookie mistake on my side, but I got a few questions regarding the test.
First, I've tried to add a new test in tests/integration/install_tests.rs to cover this change. Is this the right place to introduce the new test?
Additionally, I've followed the logic from other tests by instantiating a TestContextBuilder but I'm only able to get module not found errors when a try to install a package from npm and another from jsr without their prefixes. I can't obtain prefix errors because context's http server immediately tries to download from localhost. How can I overcome this issue within the test environment?
@mbrdg that's correct, you can call .add_npm_env_vars() and .add_jsr_env_vars() which will set up the test context to use testing registry. Then you should be able to install packages like npm:@denotest/bin and jsr:@denotest/add.
I believe that these changes caused a bug for deno install -g for local files. I have opened #26969.