Is it possible to install node latest on OpenBSD or FreeBSD?
I'd like to use a BSD operating system instead of Linux on my home server. I would run node latest on it, but it is hard to find anything about how to install node latest on those operating systems. As far as I understand they have package managers which contain only older node versions, but I haven't tried it yet. I mean it is simpler to ask than formatting the drives, settings up ZFS, encryption, etc. just to find out it is not possible...
You can build from source. Every commit that lands in node is tested on freebsd, it's part of our CI matrix. Not so openbsd but it's nevertheless fairly well maintained.
@bnoordhuis Does it work on DragonFly too? I am not an expert, but curious, what are the requirements for building nodejs? Do I need a certain type and version of C compiler? Or how do I know by reading about an OS whether it can build node latest?
@bnoordhuis Does it work on DragonFly too?
Sorry to bump in, but awhile ago I did some changes to make it buildable under DragonFlyBSD as most of the FreeBSD specifics are compatible with in a NodeJS native standpoint (minus the large page feature).
@inf3rno
I am not an expert, but curious, what are the requirements for building nodejs? Do I need a certain type and version of C compiler?
The 'requirements' are captured in the documentation at the project. In bare bones, its:
Unix prerequisites
gcc and g++ >= 6.3 or newer, or
GNU Make 3.81 or newer
Python (see note above)
Python 2.7
Python 3.5, 3.6, 3.7, and 3.8.
In reading the full page, you might glean of other tooling dependencies, or known problems/issues on other similar OS platforms... which might be straightforward (or more awkward) to circumvent!
@devnexen Thanks!
@shellberg I just asked because I am not sure about what kind of C compilers are there. I know that some of the BSDs use non-gcc compilers because of licensing incompatibility (I heard only about musl so far). I guess in theory it can be built with those other compilers too, but in practice it isn't that simple. Am I right?
@inf3rno In terms of picking up pre-built binaries, then yes, your concern might be vindicated. However, in any useable BSD Linux, you likely have a working C runtime, and compiler, at which point you may choose that you are willing to build the relevant Gnu toolchain yourself! You can decide if the licensing is an issue directly, without having the concerns of another middlemen/distributor(s) and their own agendas arising. (Once you have your own compiled toolchain - that is, compiler(s) and the runtime libraries for C, C++, etc. - you might still have some issues to 'install' it in support of the tooling you want (node's executables, etc.) in a manner that doesn't interfere with the pre-existing support of your BSD tooling. But, you are in control! ;-)
Irrespective, the version information above should enable you to connect the required level of tooling support to the potential pre-requisites that building the Node tooling requires - indeed, its usually the pre-requisites of the underlying v8 dependency (implementing the JavaScript execution engine) that is frequently coded to use the latest/recent C++ standards expressiveness that increases the bar on the compiler requirements.
@shellberg So in theory it is solvable on every BSD system. Thanks!
It's pity you need python that get packages even without proper https keys, as requirement for installing node.js, therefore you are smuggling virus in requirements.