0

I added a node module (otp-generator) to my MongoDB Realm app using the realm-cli, and it worked as expected. I'm now trying to add another node module (twilio) to my MongoDB Realm app, but for some reason it now is giving the following error message when I try to push my new node modules archive that includes both otp-generator and twilio:

push failed: failed to install dependencies: failed to transpile node_modules/otp-generator/._index.js. "otp-generator" is likely not supported yet. unknown: Unexpected character '' (1:0)

This message is very strange because the otp-generator was working perfectly fine before I installed Twilio. What's going on here?

wristbands
  • 1,021
  • 11
  • 22

1 Answers1

0

I was able to figure out a solution myself. I just uninstalled the packages, and then reinstalled twilio before otp-generator. Here are the specific steps I did:

npm uninstall twilio
npm uninstall otp-generator
npm install twilio
npm install otp-generator
tar -czf node_modules.tar.gz node_modules/

And then I pushed my changes again to Realm, and it worked!

I'm not sure if installing twilio before otp-generator is what specifically resolved the problem, but at the very least uninstalling and reinstalling installing all node modules from scratch fixed it.

wristbands
  • 1,021
  • 11
  • 22