-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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 install
changes for Deno 2
#23062
Comments
In preparation for upcoming changes to `deno install` in Deno 2. If `-g` or `--global` flag is not provided a warning will be emitted: ```⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use `-g` or `--global` flag. ``` The same will happen for `deno uninstall` - unless `-g`/`--global` flag is provided a warning will be emitted. Towards #23062 --------- Signed-off-by: Bartek Iwańczuk <[email protected]> Co-authored-by: David Sherret <[email protected]>
I would prefer to keep In npm it kind of makes sense to use |
deno install
changes for Deno 2deno install
changes for Deno 2
deno install
changes for Deno 2deno install
changes for Deno 2
This commit adds enum to "InstallFlags" and "UninstallFlags" that will allow to support both local and global (un)installation. Currently the local variant is not used. Towards #23062
This commit adds enum to "InstallFlags" and "UninstallFlags" that will allow to support both local and global (un)installation. Currently the local variant is not used. Towards #23062
I'd like to give a strong second to @Leokuma's feedback.
I'd argue that the only mismatch in expectations is for those coming from the Node ecosystem. Coming from Rust/Cargo, "install" and "add" make perfect sense. Making Plus, I'd love to keep the existing
No flags needed! |
Also, if people are not willing to learn even Deno CLI commands - which should be the very first thing to be done, and it takes 1min -, what are they willing to learn about Deno at all? They will also complain that We should make it easy for Node people to migrate to Deno rather than turn Deno into Node. |
If I understand this change correctly, it will result in the following:
The differences of behaviour here are very unintuitive. Even the '-g' flag doesn't make a lot of sense to me. Why is 'global' associated with an executable script and lack of 'global' associated with adding a dependency? This flag makes more sense in the node ecosystem where the global flag denotes 'package downloaded for use by all node projects' vs 'package downloaded for only this project'. Overall, it feels as if this change introduces more confusion than it will solve and I'm not a big fan of the two different use cases for the same command. |
We'd like to change
deno install
subcommand in Deno 2 to align it better with user expectations.EDIT (28.05.2024):
Some of the changes have already landed, further TODOs:
workspace:
specifier not supported forpackage.json
dependency #18192node_modules
on macOS #23980deno i
,bun i
,pnpm i
,yarn i
#23375Currently
deno install
is used to install script as globally available executables:While this is super useful and convenient there's a mismatch in expectations to what this command does, especially for users coming from
npm
/yarn
/pnpm
background.Proposed changes to
deno install
include:-g
or--global
flag is provided - this mimics how package managers from Node ecosystem work. This will require minimal changes on the user side and is implemented in feat(install): require -g / --global flag #23060. We need to ensure that it works correctly forjsr:
specifiers too.deno install
is run without-g
flag then it will behave like currentdeno add
subcommand - it will create an entry indeno.json(c)
file'simport
section. We will need to add support forhttp:https://
andhttps://
specifiers. This makes it an almost drop-in replacement fornpm/yarn/pnpm install <package>
(minus that we default tojsr:
specifiers and npm packages requirenpm:
prefix).--root
and--force
flags would only be available if-g
/`--global flag is provided, as they make no sense in non-global context.deno uninstall
- without-g
/--global
flag this subcommand would operate on localdeno.json(c)
file, otherwise it would act for "globally available" executables.package.json
as well - ifjsr:
specifier is used, we should set up proper.npmrc
fileWe want to enable (some of) these changes in Deno v1.42 and v1.43 with
DENO_FUTURE=1
env variable, so users can try it out as soon as possible.The text was updated successfully, but these errors were encountered: