From 59faeb188383320eb9023c752d2b93a55c84a6aa Mon Sep 17 00:00:00 2001 From: Cody Peter Mello Date: Mon, 12 Jun 2017 21:51:09 +0000 Subject: [PATCH] chrisa/node-dtrace-provider#95 Install fails with yarn --- CHANGES.md | 3 +++ package.json | 2 +- scripts/install.js | 37 +++++++++++++------------------------ 3 files changed, 17 insertions(+), 25 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 161b3b6..acdd3d5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,9 @@ dtrace-provider - Changes ## HISTORY + * 0.8.3: + Install fails with yarn + * 0.8.2: Error installing in 64-bit SmartOS zones with 32-bit node diff --git a/package.json b/package.json index 5f13b91..1749b02 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dtrace-provider", - "version": "0.8.2", + "version": "0.8.3", "description": "Native DTrace providers for node.js applications", "keywords": [ "dtrace", diff --git a/scripts/install.js b/scripts/install.js index c11f5e5..50ce5eb 100755 --- a/scripts/install.js +++ b/scripts/install.js @@ -15,41 +15,30 @@ fs.renameSync(src, dst); movedFile = true; -//npm_execpath: '/usr/local/lib/node_modules/npm/bin/npm-cli.js', -var nodegyp = path.join(process.env.npm_execpath, - '..', - 'node-gyp-bin', - 'node-gyp'); - -if (!fs.existsSync(nodegyp)) - nodegyp = path.join(process.execPath, - '..', - '..', - 'lib', - 'node_modules', - 'npm', - 'bin', - 'node-gyp-bin', - 'node-gyp'); - -if (!fs.existsSync(nodegyp)) { - console.error('cannot locate npm install'); - return; -} - var spawn = require('child_process').spawn; var stdio = 'ignore'; -if (process.env.V) +if (process.env.V) { stdio = 'inherit'; +} var options = { cwd: path.join(__dirname, '..'), stdio: stdio }; -var child = spawn(nodegyp, ['rebuild'], options); +var child = spawn('node-gyp', [ 'rebuild' ], options); + +child.on('error', function (err) { + if (err.code === 'ENOENT') { + console.error('cannot locate node-gyp'); + } else { + console.error(err); + } + + process.exit(0); +}); child.on('close', function(code, signal) { if ((code || signal) && process.env.V === undefined) {