Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find module 'browserify'

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?

like image 223
mpen Avatar asked Jan 23 '13 04:01

mpen


Video Answer


2 Answers

I was face same problem but if you want to install browserify module you can use this

       npm install  browserify        
like image 145
Anish Agarwal Avatar answered Sep 25 '22 00:09

Anish Agarwal


Try:

npm install js-base64

and if you encounter the below error

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 below command:

sudo npm install -g js-base64 --save
like image 34
DILIP KOSURI Avatar answered Sep 23 '22 00:09

DILIP KOSURI