I'm getting this error:
Error: Cannot find module 'browserify'
When I add this line to my app/server.js file:
var browserify = require('browserify'); Now I'm still new to Node, but I think I installed it correctly, via
npm install -g browserify as per their docs.
I'm pretty sure this is the command to check my global modules:
D:\Websites\MySite> npm ls -g C:\Users\Mark\AppData\Roaming\npm ├─┬ [email protected] │ ├─┬ [email protected] │ │ └── [email protected] It lists browserify there. So why can't I require it?
-gmade it work... but if-gdoesn't install libs globally, why do some many libraries recommend it? I mean, if it adds it to the path so you can call some of their tools via command-line, that's great, but shouldn't they be recommending you run both with and without-gthen?required from your code needs to be installed locally -- one of the reasons for this is that it allows each project to have different versions of the same module installed.required globally, i.e. from any project/place? I think that prioritizing locally installed modules should be enough to let projects have different versions of the same module.