In my case both node
and npm
were in same path (/usr/bin
). The NODE_PATH
was empty, so the npm
placed the global modules into /usr/lib/node_modules
where require(...)
successfully find them.
The only exception was the npm
module, which came with the nodejs package. Since I'm using 64 bit system, it was placed into /usr/lib64/node_modules
. This is not where require(...) searches in case of empty NODE_PATH
and node started from /usr/bin
. So I had two options:
/usr/lib64/node_modules/npm
to /usr/lib/node_modules/npm
/usr/lib/node_modules/*
to /usr/lib64/node_modules/
and set NODE_PATH=/usr/lib64/node_modules
Both worked. I'm using OpenSUSE 42.1 and the nodejs package from updates repository. Version is 4.4.5.