Your message dated Thu, 6 Oct 2016 12:41:03 +0200
with message-id 
<CAJxTCxwDuCG4Y=w9n5zw2opz2y4s5mwgzljxhwkyatbzu63...@mail.gmail.com>
and subject line Re: Bug#774674: prefix in nodejs and npm doesn't agree
has caused the Debian Bug report #774674,
regarding prefix in nodejs and npm doesn't agree
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
774674: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=774674
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
2015-01-06 3:04 GMT+01:00 Ivan Sergio Borgonovo <ivan....@gmail.com>:

> 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.
>

Modules installed by npm *must* be kept apart from modules installed by
debian packages, for obvious sanity reasons.
The right places are /usr/lib/nodejs for the modules installed by debian
packages,
and /usr/local for anything user-installed.

Note, however, that if you install a module in
/usr/local/lib/node_modules
node -e 'require("thatmodule")'
will work as expected (and will override the module installed by debian
package, if any).



> $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.
>

True, i've even reported a bug about that:
https://github.com/npm/npm/issues/12606

The problem is that npm looks for its global config file using a wrong
algorithm, and i didn't figure a way to work around that.

Closing, because if this is fixed one day it will be by npm in a later
version.

Jérémy

--- End Message ---
-- 
Pkg-javascript-devel mailing list
Pkg-javascript-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-javascript-devel

Reply via email to