Nexmo/verify-javascript-sdk

Cannot find module 'bluebird' when bundling with browserify

Closed this issue ยท 4 comments

npm install verify-javascript-sdk

Ensure browserify is installed globally.

npm -g i browserify

Create an index.js with contents:

var NexmoVerify = require('verify-javascript-sdk');

Run:

$ browserify index.js -o bundle.js

See the error:

Cannot find module 'bluebird' from '/Users/leggetter/tmp/verify/node_modules/native-or-bluebird'
mtt87 commented

Curious I just tested and seems like if you npm i bluebird then browserify is happy.

Still it's not clear to me why browserify wants bluebird as it's not being used in the project.
It could be a good idea anyway to add it, to "standardize" the Promise.

๐Ÿ˜„

mtt87 commented

I think I spotted the problem, when you npm i verify-javascript-sdk

npm WARN deprecated native-or-bluebird@1.2.0: 'native-or-bluebird' is deprecated. Please use 'any-promise' instead.

And that dep is related to popsicle 2.0.2.
Just checked, the new version doesn't have anymore that dep so you could update popsicle to solve it but careful they are at v8.2.0 I'm sure something has changed ๐Ÿ˜„

mtt87 commented

๐Ÿ‘Œ all fixed in dev branch, feel free to check & merge
https://github.com/Nexmo/verify-javascript-sdk/tree/dev

Product no longer in use, closing this issue