chrisa / node-dtrace-provider

Native DTrace probes for node.js apps
Other
320 stars 68 forks source link

Installation does not work on Debian #92

Closed Mistress-Anna closed 6 years ago

Mistress-Anna commented 7 years ago
% npm install dtrace-provider         

> dtrace-provider@0.8.0 install /home/ntome/build/node_modules/dtrace-provider
> node scripts/install.js

sh: 1: node: not found
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

npm ERR! dtrace-provider@0.8.0 install: `node scripts/install.js`
npm ERR! Exit status 127
npm ERR! 
npm ERR! Failed at the dtrace-provider@0.8.0 install script.
npm ERR! This is most likely a problem with the dtrace-provider package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls dtrace-provider
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 4.7.0-1-amd64
npm ERR! command "/usr/bin/nodejs" "/bin/npm" "install" "dtrace-provider"
npm ERR! cwd /home/ntome/build
npm ERR! node -v v4.7.2
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR! 

On Debian, "node" command is "nodejs", because the "node" command conflicts with other packages.

melloc commented 7 years ago

@Mistress-Anna I've updated package.json to use the $npm_node_execpath. I was then able to successfully perform npm install on Debian 8:

cody@80f4124a-b0a5-cea5-9145-955ca04c694d:~/node-dtrace-provider$ V=1 npm install

> dtrace-provider@0.8.4 install /home/cody/node-dtrace-provider
> $npm_node_execpath scripts/install.js

cody@80f4124a-b0a5-cea5-9145-955ca04c694d:~/node-dtrace-provider$ node --version
-su: node: command not found
cody@80f4124a-b0a5-cea5-9145-955ca04c694d:~/node-dtrace-provider$ nodejs --version
v0.10.29
cody@80f4124a-b0a5-cea5-9145-955ca04c694d:~/node-dtrace-provider$ npm version
{ http_parser: '1.0',
  node: '0.10.29',
  v8: '3.14.5.8',
  ares: '1.10.0',
  uv: '0.10.27',
  zlib: '1.2.8',
  modules: '11',
  openssl: '1.0.1k',
  npm: '1.4.21',
  'dtrace-provider': '0.8.4' }

These changes are now on npm in version 0.8.4.

melloc commented 7 years ago

I've reverted these changes since they break installing on Windows. I can't find a good solution for supporting installation in both environments that use different syntax for environment variables and have differently named binaries, so for now users with different binary names will need to set up symbolic links or wrapper scripts and their PATH appropriately. (Some Debian systems also ship the node-legacy package, which seems to be the same as the nodejs package but it creates a node binary instead of nodejs.)

melloc commented 6 years ago

With dtrace-provider@0.8.6, as long as the dependencies for running node-gyp are present (GNU Make and Python 2), installing on Debian should no longer be an issue.