Error: Cannot find module 'openpgp'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
Hello guys,
I'm using babel to transpile my code.
The problem is that openpgp doesn't work when the code is transpiled.
I found a workaround. I've created a node_modules folder inside the build folder and I've copied these packages inside it:
With this solution, I can use openpgp.
Can you check that.
I've tested without babel and openpgp is working without any issues.
Unfortunately, I've need babel.
OS: Linux & macOS
Node version: 8.16.0 - 10.16.0
Babel version: 6.26.0 (old one)
Building openpgp.js using babel as part of a larger project is not really supported at the moment. If you can, I'd recommend including the build file directly using a script tag for now.
Thank you for the solution! I will use it while this issue is resolved.
I'd been facing to similar issue too.
if same cause, it can use another workaround maybe.
~https://github.com/vercel/ncc/issues/538#issuecomment-695008868~
This should be fixed by #1047 (in the upcoming v5 release).
Thank you very much !
You rock ! 馃殌