Closed algesten closed 8 years ago
Short answer: nar will embed the generated binaries of the current platform where the executable was built, so there will be incompatibility if you run the binary in other platform (or even in other incompatible node.js version).
Originally nar doesn't provide built-in support to deal with native addons. but I believe there're multiple choices to find a consistent solution.
One that just come to my mind could be as simple as defining a postinstall or prestart npm script in your package.json in order to run the proper npm command to rebuild those packages who uses platform specific native addons.
Give it a try and I will appreciate if you let me know if that solution is fine to you.
what we ended up doing is relying on .nvmrc
so that our build script will do:
$ nvm install # using .nvmrc for node version
$ nar create ...
If I run nar under node 0.12.x on mac os x and do something like:
nar create --executable --os linux --arch x64 --node 5.1.0
What happens to the node-gyp compiled binaries? Will there be an
npm rebuild
once the archive has unpacked on the target platform?