I'm learning javascript, and I tried to import some modules using npm in my js file. For some module, import using require()
works fine, but I don't know why, for openpgp.js I got a Uncaught Error: Cannot find module 'openpgp'
.
Here the setup of my app : app config
I run npm install openpgp
inside my js file. In my js I import modules by typing var openpgp = require('openpgp');
, Then I refreshed my browser and see my error : browser error
For information, when I using the node console, modules works fine !
I'm realy new in javascript, so may be I do something wrong. If someone have an idea it's would be helpful !
via Lbrth_BoC
No comments:
Post a Comment