-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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 <biwanczuk@gmail.com> Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
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. |
Surprisingly yes it does make a difference, humans are weird like that. I wouldnt think so either but I have cognitive science background, I can confirm every bit of friction makes an exponential difference in adoption. Its like having someone randomly change one of the keyboard shortcuts you use on the daily. It creates an annoyance and that annoyance gets associated with deno.
This I agree with 100%. Theres ways to lower friction without turning deno into node |
I think a If that solution is ignored, then I'm in favor of @NfNitLoop 's solution. Rename install to something else. In particular, if theres ever going to be local scripts (think npx) then And if that solution is ignored, then I'd even be in favor of deprecating |
I agree and don't need a cognitive science background to confirm this. However, changes like this can be seen as a choice regarding which groups you want to cater to and which groups you're willing to annoy. Any changes to command names will annoy existing Deno users and users who are more familiar with the existing command names. Even when catering to Node users, npm is not the only Node package manager. Two other commonly used ones include Yarn (Classic and Berry) and pnpm. Both of them use I will also note that, at least to me, if a command "installs" Personally, I'm currently in favour of @NfNitLoop's proposal the most, especially |
All of the changes described in this issue were implemented and shipped in the past few releases. You can try them out in earnest upgrading to Deno
|
Solid point
Same. I also really struggled when googling how to global install something for deno. "How to Install deno" results kept flooding out how to install a script. deno install-script won't necessarily make it more google-able but it certainly wont hurt. |
Closing this one as all the changes from this issue are already implemented. |
I support this change, it was very confusing learning about Now I wish a simple "install": "deno cache --reload --config=deno.json --lock=lock.json deps.ts", @bartlomieju I know this is not NPM, but I kinda want to improve the onboarding experience of my project for people who know and love NPM. Can I somehow alias |
You'd need to provide a shell alias to do that. |
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://
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: