[Pkg-javascript-devel] NPM: Cannot find module installed globally

Leo Iannacone l3on at ubuntu.com
Sat Sep 20 17:44:32 UTC 2014


Hi,

with npm 1.4.21+ds-2 I'm not able to require module installed globally...

See this:

$ sudo npm install -g coffee-script
/usr/local/bin/coffee -> /usr/local/lib/node_modules/coffee-script/bin/coffee
/usr/local/bin/cake -> /usr/local/lib/node_modules/coffee-script/bin/cake
coffee-script at 1.8.0 /usr/local/lib/node_modules/coffee-script
└── mkdirp at 0.3.5

$ nodejs -e "require('coffee-script');"

module.js:340
    throw err;
          ^
Error: Cannot find module 'coffee-script'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at [eval]:1:1
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:456:26)
    at evalScript (node.js:532:25)
    at startup (node.js:80:7)
    at node.js:902:3


Is this happening only to me?

Leo.



More information about the Pkg-javascript-devel mailing list