Skip to content

Instantly share code, notes, and snippets.

@okuryu
Created March 10, 2012 08:14
Show Gist options
  • Save okuryu/2010804 to your computer and use it in GitHub Desktop.
Save okuryu/2010804 to your computer and use it in GitHub Desktop.
Compare npm root on Node v0.6.12/v0.7.5/v0.7.6-pre
$ pwd
/Users/okuryu/work/npm-global
$ node -v
v0.6.12
$ npm -v
1.1.4
$ npm root
/Users/okuryu/work/npm-global/node_modules
$ npm root -g
/usr/local/lib/node_modules
$ npm prefix
/Users/okuryu/work/npm-global
$ npm prefix -g
/usr/local
$ npm config get prefix
/usr/local
$ node which.js
node: /usr/local/bin/node
$ node -e "console.log(process.argv[0])"
node
$ pwd
/Users/okuryu/work/npm-global
$ node -v
v0.7.5
$ npm -v
1.1.1
$ npm root
/Users/okuryu/work/npm-global/node_modules
$ npm root -g
/Users/okuryu/work/lib/node_modules
$ npm prefix
/Users/okuryu/work/npm-global
$ npm prefix -g
/Users/okuryu/work
$ npm config get prefix
/Users/okuryu/work
$ node which.js
node: /Users/okuryu/work/npm-global/node
$ node -e "console.log(process.argv[0])"
/Users/okuryu/work/npm-global/node
$ pwd
/Users/okuryu/work/npm-global
$ node -v
v0.7.6-pre
$ npm -v
1.1.1
$ npm root
/Users/okuryu/work/npm-global/node_modules
$ npm root -g
/usr/local/lib/node_modules
$ npm prefix
/Users/okuryu/work/npm-global
$ npm prefix -g
/usr/local
$ npm config get prefix
/usr/local
$ node which.js
node: /usr/local/bin/node
$ node -e "console.log(process.argv[0])"
node
var which = require('which');
which(process.argv[0], function (er, node) {
console.log('node: ' + node);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment