[Pkg-javascript-devel] Bug#774674: prefix in nodejs and npm doesn't agree

Ivan Sergio Borgonovo ivan.s.b at gmail.com
Tue Jan 6 02:04:26 UTC 2015


Package: nodejs
Version: 0.10.29~dfsg-1.1


When installing packages with npm with -g option packages get written to
/usr/local/lib/node
but evidently nodejs search them somewhere else (probably /usr)
Infact it seems debian nodejs packaged modules install modules in
/usr/lib/nodejs.

$NODE_PATH is not set in debian package but that's what I've been told:
https://github.com/nodesource/distributions/issues/50

One thing that should be kept in mind is that if you update node as in

npm install n
n [another version]

or you update the package manager, things may mess up once more.

Relevant page of node manual:
http://nodejs.org/api/modules.html
https://docs.npmjs.com/misc/config

# Package: npm
# Version: 1.4.21+ds-2

$ npm config get prefix
/usr/local

$ cat /usr/share/npm/npmrc
# DO NOT MODIFY THIS FILE - use /etc/npmrc instead.
globalconfig=/etc/npmrc
globalignorefile=/etc/npmignore
prefix=/usr/local

$ node -e 'console.log(process.config.variables.node_prefix);'
/usr

thanks

-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it



More information about the Pkg-javascript-devel mailing list