Error: Cannot find module 'imap' while trying to use node-imap

Hi Glitch, so I’m working on a SVG Player to replay hand written notes chronologically. It’s working relatively well. Unfortunately most of the hardware have no API but does provide exporting via email. To bypass that I registered an email (svgplayer@gmx.com) that would receive all SVGs and send them to an endpoint. This would then allow the player to embbed them via URL (already working).

Unfortunately when I try to use node-imap on Glitch I get Error: Cannot find module 'imap' preventing me to go further. I did try enable-npm but so far no suggest.

What can I try next?

Hey @Utopiah as far as I know, IMAP isn’t built into the Node.js standard libraries, so you have to install it as a package. Adding "imap":"^0.8.*" to your package.json should get you going.

1 Like

Damned that’s obvious! My bad I thought somehow the package itself (since I imported from github) would have it as a dependency. Thanks a lot!

1 Like