Closed andrewrk closed 10 years ago
Note this also prevents npm2deb from working for projects that depend (possibly indirectly) on modules that have this issue.
Just a hint:
This is not a problem directly connected to npm2deb, but it's related to nodejs binary name in Debian (some scripts expect a node binary instead).
To quickly workaround this issue, please set an alias in this way: $ alias node='nodejs'
For more info about node binary renaming please refer to Debian wiki page Node.js Policy (Manual).
Thanks this helped me get past the issue. Although I had to sudo cp /usr/bin/nodejs /usr/bin/node
temporarily, it seems the alias didn't work in the subshell that npm2deb spawned.
The alias does not work. Confirmed.
The sudo cp /usr/bin/nodejs /usr/bin/node
is the only workaround.
I don't know how to fix this internally to npm2deb, since it is more a system wide problem. We should reconsider to use node
as Node.js binary? @kapouer
@andrewrk you're supposed to add a quilt patch to binding.gyp to rename node to nodejs. @LeoIannacone did you forget https://wiki.debian.org/Javascript/Nodejs/Manual#Patching_binaries_shebang ?
Actually the example I gave can be quilt patched to be deleted. For example see http://anonscm.debian.org/gitweb/?p=collab-maint/node-ws.git;a=blob;f=debian/patches/rm-redundant-legacy-include;h=391b8077ef335a9073c85fd70bd989be036bd762;hb=refs/heads/master
It's only a problem when using npm2deb create
.
@kapouer no, absolutely. The problem is if nan is going to be downloaded via npm.. it will use "node" binary (since it's not patched).. so "npm install" fails.
maybe when npm2deb spawns a subshell to run the npm install command, it could modify PATH in the subshell only and add a directory which provides node as a link to /usr/bin/nodejs. This would avoid tampering with the system but still allow npm install
to succeed for the duration of npm2deb create
@LeoIannacone that's precisely the reason why nodejs-legacy package is available - to make sure people can use npm as they do without the rename.
@andrewrk @kapouer I think as fast workaround I would suggest users to install nodejs-legacy.
For the future, I would think something new: now npm2dep run a "npm install" against the module.
Since the most of them (node modules) comes from github I could edit npm2deb to get source directly from github instead of getting the npm version..
I will think on it.
Hey did you notice that was in console output of the failed build ?
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
Hi,
I'm marking this issue as "won't fix" since it is related to nodejs binary renaming.
Consider to install node-legacy as workaround while debianize this kind of modules.
For example leveldown has binding.gyp with:
See node-ws for an already completed example that has this setup.