Cannot find 'browserify' module

I get this error:

Error: cannot find module 'browserify'

When I add this line to the app / server.js file:

var browserify = require('browserify'); 

Now I'm still new to Node, but I think I installed it correctly,

 npm install -g browserify 

according to your documents .

I am sure this is the command to test my global modules:

 D:\Websites\MySite> npm ls -g C:\Users\Mark\AppData\Roaming\npm β”œβ”€β”¬ browserify@1.17.2 β”‚ β”œβ”€β”¬ buffer-browserify@0.0.4 β”‚ β”‚ └── base64-js@0.0.2 

A list of browsers is displayed here. So why can't I require this?

+6
source share
3 answers

I had the same problem, but if you want to install the browser module, you can use this

  npm install browserify 
+11
source

Try:

 npm install js-base64 

and if you encounter an error below

 npm ERR! Error: EACCES: permission denied, unlink '/Users/host/module/node_modules/npm/node_modules/.bin/node-gyp' npm ERR! at Error (native) npm ERR! { [Error: EACCES: permission denied, unlink '/Users/host/module/node_modules/npm/node_modules/.bin/node-gyp'] npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'unlink', npm ERR! path: '/Users/host/module/node_modules/npm/node_modules/.bin/node-gyp' } npm ERR! npm ERR! Please try running this command again as root/Administrator. 

then use the following command:

 sudo npm install -g js-base64 --save 
+2
source

I need to find another way to install the browser globally so that you can use this command for linux

 sudo npm install browserify -g 
+1
source

All Articles