npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

node -r doesn't find global package

Hello,

I use docker node:8.

I installed my local package like this:
npm install -g ./mypackage

then:
npm ls -g
shows the globally installed package.

But if I RUN:
RUN node -r mypackage
then:
it throws a cannot resolve ‘mypackage’

Why doesn’t node find the global package ?

Thank you in advance for your help.


ASFAIK, node doesn’t look for modules in your global npm install dir. Try running npm install ./mypackage (no -g).