“Error: Cannot find module ‘jsonwebtoken’ “ with My Own Plugin

Hi everyone, I build my own plugin to create JWT token for doordash. However I am getting this error Cannot find module 'jsonwebtoken' Require stack even though I build all dependencies under Require('jsonwebtoken')

Full error : Workflow error - Plugin action Create-Test-JWT error: Error: Cannot find module 'jsonwebtoken' Require stack: - /var/task/index.js - /var/runtime/UserFunction.js - /var/runtime/index.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15) at Function.Module._load (internal/modules/cjs/loader.js:667:27) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at eval (eval at build_function (/var/task/index.js:86:21), <anonymous>:2:13) at /var/task/index.js:349:23 at run_fn (/var/task/u.js:594:18)

Do you have any idea what should I do?

This problem just happens to me also.
I was able to make it works by rebuilding the package.json as follow:

"dependencies": {
    "jsonwebtoken": "8.5.1"
1 Like