nodejs / unofficial-builds

Unofficial binaries for Node.js
https://unofficial-builds.nodejs.org
242 stars 50 forks source link

Documentation for installing #6

Open mitra42 opened 5 years ago

mitra42 commented 5 years ago

This is a great project - and as one of the platforms we'd like to support dweb-mirror is the 32-bit Rachel box, its timely.

BUT ... needs some docs, similarity to nodejs.org/download doesn't help those of us used to getting our node installations with apt-get, I couldn't figure out how to install these binaries.

Note that I'm not a node developer, but happy to incorporate it into our install, and report issues we find to the project's github.

rvagg commented 5 years ago

Pull requests to edit the www directory are welcome. Web dev isn't my forte but would love to have someone help make it more presentable.

There is already a link from https://nodejs.org/en/download/ to it fwiw, but that just goes to the downloads directory. If we had a nicer index page then we could make it link to that.

Let us know how these builds go for you, feedback would be appreciated!

mitra42 commented 5 years ago

I'm sorry, I'd love to give feedback but I was serious, I have zero idea how to install one of these builds, since I normally use apt-get to get node on the smaller platforms (which often don't have web browsers).

That's the documentation I was requesting, and I can't write a PR for the docs, without knowing how to do it in the first place !

But ... since this was closed, I guess I'm not the target audience for testing it?

(FWIW I'm a developer not of node, but of the JS based version of Internet Archive's server, which is intended to run on really small platforms in remote schools for example).

rvagg commented 5 years ago

OK, I get your point, sorry for the premature close.

So these binaries are the same style as available on nodejs.org, you'd install them the same was as you'd install those. But if you're using a third-party source (such as an apt repo) then, yeah, I can understand why it might not be straightforward.

The simplest way is to grab the tarball you want, linux-x86 in your case (e.g. https://unofficial-builds.nodejs.org/download/release/v12.6.0/node-v12.6.0-linux-x86.tar.xz) and unpack it into /usr/local, stripping out the top level directory.

You could achieve this with something like curl -sL 'https://unofficial-builds.nodejs.org/download/release/v12.6.0/node-v12.6.0-linux-x86.tar.xz' | xzcat | tar -vx --strip-components=1 -C /usr/local/.

I have an install script that I use to get the "latest" Node, I've just updated it to hopefully work with unofficial-builds & x86 but I don't have the means to test it. Grab it from https://gist.github.com/rvagg/742f811be491a49ba0b9 and let me know how it goes. You could reuse the logic in here if you have a custom workflow. It also takes a --line that you could specify 12 if you want to make sure you pin to 12 even when 13 comes out. If you're customising this, note that it will use https://unofficial-builds.nodejs.org/download/release/index.tab to figure out which is the "latest" for the release line that you want.

There's also instructions floating around in this issue tracker for using nvm as well, there's an environment variable you can pass to it.

These might make good docs, but I'm not sure we want to make either of these things the "official" way of doing it since the "official" way is really just to download them and manually unpack them.

mitra42 commented 5 years ago

Super - I'm in SF for Dweb Camp at the moment, and the 32-bit box is back in Australia so will try it out in a couple of weeks and let you know.

robdejonge commented 2 years ago

Apologies for hijacking this issue, but my challenge is also that I am not understanding the steps to achieve a compiled version. I've cloned the repo, went into the armv6l directory and did 'docker build .' and the container successfully built. But ... now what!? I've tried running the container, but that doesn't seem to achieve anything. What am I meant to do to proceed with this?

bnielsen1965 commented 2 years ago

@mitra42 As an additional reference, I have a bash script I use to install and switch between multiple versions of nodejs. https://github.com/bnielsen1965/nodejs-install. It takes care of the download if needed and will use "alternatives" if that is the method provided on the host system, otherwise it uses symlinks.

robdejonge commented 2 years ago

Thanks @bnielsen1965 for the effort put into writing that script. It worked a charm on my Pi Zero W. Awesome!