Skip to content

Commit

Permalink
handle installs from decoupled npm
Browse files Browse the repository at this point in the history
  • Loading branch information
tjfontaine committed Oct 25, 2014
1 parent 542557d commit fe6424c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion scripts/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ fs.renameSync(src, dst);

movedFile = true;

var nodegyp = path.join(process.execPath,
//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',
Expand All @@ -25,6 +32,11 @@ var nodegyp = path.join(process.execPath,
'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';
Expand Down

0 comments on commit fe6424c

Please sign in to comment.