Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'body-parser' error #1

Open
dopoto opened this issue Mar 29, 2019 · 1 comment
Open

Cannot find module 'body-parser' error #1

dopoto opened this issue Mar 29, 2019 · 1 comment

Comments

@dopoto
Copy link

dopoto commented Mar 29, 2019

After following the instructions in https://github.com/vikasjayaram/ext-idp-api-webtask/blob/master/RS256/README.md, I get the following error when I open the created web task URL in a browser:

{ "code": 400, "message": "Compilation failed: Cannot find module 'body-parser'", "error": "Cannot find module 'body-parser'", "stack": "Error: Cannot find module 'body-parser'\n at Function.Module._resolveFilename (module.js:548:15)\n at Function.WebtaskModule._resolveFilename (/data/sandbox/lib/module.js:25:27)\n at WebtaskModule.require (/data/sandbox/lib/module.js:102:39)\n at require (/data/sandbox/lib/module.js:137:21)\n at Object.<anonymous> (/data/io/9bb6fba5-6d3c-4779-9ebc-32280416b3dd/webtask.js:5:20)\n at WebtaskModule.compileWebtask (/data/sandbox/lib/module.js:96:34)\n at defaultJavascriptCompiler (/data/sandbox/lib/compiler.js:119:30)\n at defaultCompiler (/data/sandbox/lib/compiler.js:128:16)\n at /data/sandbox/lib/compiler.js:231:17\n at /data/sandbox/node_modules/async/dist/async.js:3880:24" }

What should I do to fix this problem?

@dopoto
Copy link
Author

dopoto commented Mar 30, 2019

Made it work by adding a package.json file with the contents below in the same folder as the .js file:

{ "dependencies": { "moment": "2.24.0", "body-parser": "1.18.3", "express":"4.16.4", "webtask-tools": "3.4.0", "async":"2.6.2", "express-jwt": "5.1.0", "jwks-rsa": "1.1.1" } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant