You are not logged in.
After a recent upgrade of NPM and nodejs I tryed to run a node project that was working fine until then. Now I get this error:
Error: Cannot find module 'express'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/luca/Sources/birdcage-next/index.js:3:27)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)So I looked at the ArchWiKi and it says that npm installs modules under
/usr/lib/node_modules/npm/node_modulesand indeed express is not there.
So I ran
sudo npm install -g expressand I discovered that express has been installed in
/usr/lib/node_modules/It looks like nodejs and npm does not point to the same folder. How can I fix that?
Offline
+1
Yeah I've got the exact same problem.
Workaround:
echo 'export NODE_PATH="'$(npm root -g)'"' >> ~/.profile
More information:
https://stackoverflow.com/questions/134 … dules-path
Last edited by onecmc (2017-08-02 09:15:22)
Offline