Node.js now available in Haiku | Haiku Project

I haven’t had the time to fully clean it up yet, so there will be some issues when compiling them (just minor issues but they will be fixed). I’ve added documentation for the bindings but I’ll continue to clean it up on GitHub as soon as I release it shortly.

1 Like

Great, thank you.

The bindings have now been released here: https://github.com/return/haiku-api-js

7 Likes

just for test purpose, i make a server… but the response in the browser never ends. Anyway the request are listen by node becose hes write in the console… work still needed in node or im doing some thing wrong?

screenshot1

Hi,
Attempting to install modules with npm and running into error related to read-only file system.
Is there a known workaround?

Thanks

Install from Haikudepot application , the package manager will handle the rest

Try --prefix

or the environment variable npm_config_prefix

I just tried running NodeJS on Haiku,it installs successfully but throws the following error whenever I enter a node or npm command:

runtime_loader: /boot/system/bin/node: Could not resolve symbol 'uv__io_check_fd'
resolve symbol: "uv__io_check_fd" returned: -2147478780
runtime_loader: /boot/system/bin/node: Troubles relocating: Symbol not found

That’s all it does,it instantly quits afterwards.
I’m running Haiku Beta 3 x86_64 with all updates installed.

Probably a recent change in libuv. Try to rebuild node locally against the current libuv, and if it works, create a PR with a revision bump at HaikuPorts.

Building with haikuporter throws some errors as well: https://transfer.sh/IsgLET/node-build-error.log

Missing uv symbols everywhere.
It seems i have bumped the libuv recipe last time:

Maybe the npm recipe needs to be bumped too? Idk.
Could you try to revert the libuv bump, build the previous version and build npm against that?

After reverting the last libuv update and building the older version,the nodejs12 package builds just fine and works.
npm doesn’t need to be updated,the version from pkgman works alright with the self-compiled nodejs package.

Looks like the issue mentioned here? https://github.com/libuv/libuv/pull/1188#issuecomment-272976817

1 Like

Nevermind, this was fixed in nodejs14 and nodejs16 upstream, but not in nodejs12. Backporting manually and is fixed by https://github.com/haikuports/haikuports/commit/d89e4f81b3dad599dbd770e765012865fc71aad9
Will be available shortly.

4 Likes

Thank you very much,I’ll try that tomorrow.

The new node12 commit builds successfully with libuv from HaikuDepot :+1:
I still have an issue when trying to use NodeJS,however.
I wanted to use the p2p chat app cabal ( https://cabal.chat ) what should be as easy as npm install cabal and running with npx cabal.
It installs successfully,but when trying to run it,I get the following huge error log: https://transfer.sh/MqeooK/node-cabal-log.txt
I also tried it with the self-compiled libuv and nodejs yesterday already and got the same error.

The native BeAPI bindings ( https://github.com/return/haiku-api-js ) also don’t work anymore.
Running npm install throws the following error: g++: error: unrecognized command-line option '-pthread'
I tried fixing that by rewriting it to -lpthread in nbind.target.mk,but npm install always rewrites it back to -pthread before trying to build it.
I wasn’t able to fix that :frowning:

Looks like an out of memory with v8. No idea how to go from here.

Beware nodejs12, nodejs14 don’t have conflicts defined. /bin/node can be any of them. Make sure to check the version when running /bin/node or /bin/npx.