If I install Benchmark.js locally with npm install benchmark than everything works good:
require("benchmark") > Object
But when I try to install Benchmark globally with -g flag npm install benchmark -g, Nodejs cannot find the module (remove first the locally installed benchmark):
require("benchmark") > Error: Cannot find module 'benchmark'
I tryed under Windows and Linux both. The same results. Locally work, globally not. Can anyone help me WHY?
The mongodb module works globally.
You can do it using
npm link. For example – express –npm link expressA symbolic will be created linking express