I need to make one node module run in browser. The node module is fury.js. I tried browserify but when trying to use it it gives error "ReferenceError: fury is not defined". In browserify js/main.js, I only did a 'require' var fury = require('fury');
. An output file was also generated by browserify but I'm not able to use it in my browser, because of the error mentioned above. I am very novice in nodejs & browserify world, need some help.
Asked
Active
Viewed 163 times
0

Tirtha
- 145
- 2
- 17
-
Updating `var fury = require('fury');` to `global.fury = require('fury');` resolved the problem, details can be found here :http://stackoverflow.com/questions/23480336/defining-global-variable-for-browserify – Tirtha Jun 29 '16 at 21:55
1 Answers
0
You need to install the package locally using npm in order to be able to use it via browserify:
npm install --save fury

TimoStaudinger
- 41,396
- 16
- 88
- 94
-
earlier I did it without --save option, now I did as you suggested, but no difference. This is the link to the file[link](http://www.filedropper.com/fury) generated by browserify. Command used is : `browserify js/main.js -o js/fury.js` – Tirtha Jun 29 '16 at 21:09