-
Notifications
You must be signed in to change notification settings - Fork 193
Install via npm #6
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
Comments
I think one of the main reasons for using Deno is npm.
|
@Nima-Ra Hi Nima, glad to see you here :) Even though Deno is not going to support npm internally as a JS package manager, here we are more likely talking about npm as just a package manager. So I'm +1 on this. |
It looks like @YounGoat already published to npm |
I created dvm to manage and install multiple versions of deno, inspired by nvm |
Those who have
to install specified (or latest) version. It didn't exist so I decided to accept the challenge: |
To expand on what @vladimyr said, and for those who don't know, Node itself is actually on npm. So there's existing precedent for this sort of thing and it's super convenient. I chuckle a little bit when people use $ npx node --version
v11.6.0
$ npx node@10 --version
v10.15.0 Here's the repo that enables that: https://github.com/aredridel/node-bin-gen How awesome would it be if you could do the same thing to access Deno? This would be a wonderful and convenient way for people to discover, learn, and begin playing around with Deno. This wouldn't involve any functionality in Deno itself and it's not something that would be used over the entire course of developing a Deno app. Rather, it's about getting new users on board. It's basically just packaging for Deno, effectively a method of temporarily installing Deno for demo or experimentation purposes. It would probably increase adoption a fair amount. |
@sholladay
but in order for that to happen npm's target package name needs to get repurposed: #6 (comment) https://unpkg.com/deno/
Sorry but this is plain wrong. People don't use
If you say so, I don't really buy it. It is relatively easy to implement what you envisioned but making that play nicely/intuitively with |
I wasn't referring to
Nah,
This point doesn't make sense to me. The goal of any of these systems we've been discussing is to install Node. Obviously you have to install something first since none of these things come with the operating system. So, IMO, go install some version of Node that will be your default for everyday use, it will come with
I would hope that |
I still believe |
True that but it isn't really possible. |
Would that work in your opinion? |
|
Then let's check whether we're in a regular directory and remove the
We could run Also, how about installing with This is looking less likely to be easy to maintain, but I think it's definitely doable. |
Correction: Just tried it. Clean-up of node_modules from a post_install hook is not possible. npm will somehow just re-create node_modules. So we'd have to go for
|
How about this?
{
"name": "deno",
"version": "0.1.0",
"scripts": {
"postinstall": "node postinstall.js"
}
}
const child_process = require("child_process");
if (process.platform === "win32") {
child_process.execFileSync("powershell.exe", ["-c", "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://deno.land/x/install/install.ps1 | iex"]);
} else {
child_process.execSync("curl -L https://deno.land/x/install/install.sh | sh");
} And then Node users just need run |
This would also be nice since |
The deno package name is squatted? https://www.npmjs.com/package/deno 👍 If it allowed |
Here’s npm’s dispute resolution process which allows the takeover of a squatted package name: https://www.npmjs.com/policies/disputes |
cc @YounGoat |
I sent an email to @YounGoat and cc'd support@npm following https://www.npmjs.com/policies/disputes, hopefully they will transfer to @ry one way or the other. 🤞 |
All right, fair point. Closing for now. |
Maybe, but it would be much much better if this was under ry's controller rather than someone else. @YounGoat What about calling yours |
@MarkTiedemann I might get some time in future to go back to our technical conversation but in the meantime I'll point you to following chain of tools used one by another when you hit
That is how it should be done in order to not mess up with someones workspace and/or global As much as I'm not in favor of exercising strength over some squatted package name (even though I understand your good intentions) I'm also not amused when someone uses my work as part of his flawed argument. @YounGoat Let me make things clear:
There is clear difference between unofficial installer and official installer/runner so please refrain from using |
@YounGoat You describe your
This was certainly my idea when I created this issue, but then again, my ideas aren't "official". I'm not sure what @ry thinks about this. |
So, the issue is not about what is the correct way of I agree with @vladimyr and @sholladay to run Deno once by However, official is not the reason. Otherwise, the world of NPM should be overturned because there are so many packages which are under status of "un-official". |
So, the sage continues, @YounGoat refuses to cede ownership:
|
And continues to use
Except now it becomes semi-offical whatever that means... |
Sorry @vladimyr, I will delete the words about get-deno in next version. |
|
Just popping by to say this setup was kinda how I was hoping I could install deno as a sneaky script runner in the Contributors could |
Whoa, did not realize this thread exists... Worth noting a similar event happened when Personally my attitude is okay with @YounGoat keeping the Over potential conflicts like this one, I believe we should demonstrate a welcoming attitude to anyone who provides any means of help to the community. Animosity is not helpful after all. (don't open unless you are okay with seeing some harsh words)A good friend of mine has been warning me about actively participating with community discussions saying quote "JS community is a bunch of 'axx-xxxxs'", and I am very sad to have seen quite some toxic dramas in recent years. I really hope the we can avoid creating more of such situations and try creating a better atmosphere to prove that my friend is wrong. I have also just registered https://www.npmjs.com/org/deno_land in case we need an org account to host packages at some point. I will invite other contributors if somehow this is decided to be the account we want to host stuff with. |
For a historical note, I began the npm dispute process when there was zero code in YounGoat's repo and there was also no response via email or on GitHub. Since then they responded and ry told me to drop it. Now it's very different, there is an actual meaningful project that's being regularly updated. I still think it's silly not to be under ry's control but whatever. The matter is closed. |
I completely agree.
It surely is legally right for they to keep it and push hard to stay that way. Is it morally right is a different type of story that heavily depends on your perspective and set of standards. Also, life would be too simple if all actions could be sorted into good and bad will buckets. Seeking (collateral) fame through package name squatting doesn't really fit any of those. Welcome to the gray zone. 😉
This was already disputed by @hayd and can be easily verified by going through git history. I think you went too far with that statement because not everyone that releases something with deno in its name is trying to help the community. That doesn't mean they are trying to do any harm but every action isn't helpful per se, it just boosts public interest.
I agree with your point about animosity but let's not forget that relationships go both ways. Both sides should have an initial welcoming attitude that eventually gets adjusted according to direction and tone of the conversation and I'm not sure that is what happened here. This brings me to @hayd's comment #6 (comment)... His comment edit history is pure gold 😉 Because these days everyone became so obsessed with form over substance and because I'm old enough that I don't give a #%& here comes the ugly version:
|
@orta FWIW different npm packages can contain equally named binaries so it can be resolved by publishing |
Maybe we could name the package |
Just please don't build it the same way: https://npmfs.com/package/flow-bin/0.113.0/ cause it is pretty weird to pay download penalty for binaries you can't and won't ever use: https://packagephobia.now.sh/result?p=flow-bin |
you should just use
Seriously, if you think nvm is awesome... throw it out and start using asdf. literally everywhere you think you have to use nvm, you can replace it with |
just for notice - deno-bin npm package - https://www.npmjs.com/package/deno-bin exists for a long time. It works good enough and it's maintained by one of deno core members (I think). |
We finally got ownership of the |
Deno is now available on npm: https://www.npmjs.com/package/deno |
Uh oh!
There was an error while loading. Please reload this page.
I guess npm would be the most familiar way for Node developers to install Deno.
So how about a simple
postinstall
script in thepackage.json
so you can runnpm install deno
to install Deno into$HOME/.deno/bin
?npmjs.com/deno is already taken by a "Bridge to deno" package that only has a README so far, but we could ask the author of that package to transfer ownership.
The TypeScript declaration files could be published in the package, too.
If we did that, editors that don't know about Deno, but that do understand TypeScript and auto-download declaration files for code-completion from npm (for example, VS Code), would make it very convenient to get started: You would just have to create a
my-script.ts
file, open it in your editor, typeimport * as deno from 'deno'
, and the editor would give you auto-complete, so you could typedeno.en
, hit tab,deno.env()
would be auto-completed, and you could hover overdeno.env()
with your mouse to read the docs ... That would be very convenient. :)The text was updated successfully, but these errors were encountered: