Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

[UNIX] Prebuilt binaries are not working. #80

Closed
fs-eire opened this issue Oct 18, 2017 · 7 comments
Closed

[UNIX] Prebuilt binaries are not working. #80

fs-eire opened this issue Oct 18, 2017 · 7 comments
Assignees
Labels

Comments

@fs-eire
Copy link
Contributor

fs-eire commented Oct 18, 2017

Problem

Pre-built binaries are not working on Linux and MacOS.

npm install napajs
node -e "require('napajs')"

module.js:597
return process.dlopen(module, path._makeLong(filename));
^
Error: libnapa.so: cannot open shared object file: No such file or directory

Solution

Update napa.js to version 0.1.4 or later to resolve this issue.

Workaround

1. export LD_LIBRARY_PATH=./node_modules/napajs/bin:$LD_LIBRARY_PATH before launch node.
2. Use npm install --no-fetch so the install script will fallback to build napajs. See this for more information.

Root Cause

The file 'napa-binding.node' was using absolute path in its rpath before v0.1.4. This causes the pre-built file cannot be loaded in runtime.

@snood1205
Copy link

This suggestion might sound a bit odd, but what about the npm package for napajs relying on having libnapa instead of installing native extensions like it does right now and break out libnapa into its own shared lib.

@daiyip
Copy link
Contributor

daiyip commented Oct 19, 2017

Thanks for the suggestion. Do you mean to publish a NPM module 'libnapa', and have 'napajs' depend on it?

@snood1205
Copy link

Yeah pretty much for libnapa to be distributed as a .node addon binary on its on and then have napajs depend on it. It seems like breaking up the JS and C/C++ into different repos would allow for a bigger focus on portability within the libnapa repo as people who want to work on the C/C++ part of this would be drawn to libnapa.

@daiyip
Copy link
Contributor

daiyip commented Oct 20, 2017

At a glance, napajs is just a node binding of libnapa, an one-way dependency. But the concept of Node zone makes things interesting. As Node event loop is exposed via Zone interface, workers in Napa zone can offload IO tasks to Node when Napa doesn't support IO related Node modules. Under this design, libnapa also collaborate with napajs to access Node event loop. So separation of them is not feasible here.

@daiyip
Copy link
Contributor

daiyip commented Oct 20, 2017

Close as solved.

@woodyrew
Copy link

I still get an error with 0.1.4:

$ npm ls napajs
[email protected] /home/username/napa-test
└── [email protected]
$ node -e "require('napajs')"
module.js:598
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /home/username/napa-test/node_modules/napajs/bin/libnapa.so)
...

Even with the paths added.

export LD_LIBRARY_PATH=./node_modules/napajs/bin:$LD_LIBRARY_PATH

@helloshuangzi
Copy link
Contributor

@woodyrew thx for your feedback. Please refer to issue#93 for 'GLIBCXX_3.4.22' error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants