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

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function #10

Closed
alfrekjv opened this issue Jan 1, 2018 · 2 comments
Closed

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function #10

alfrekjv opened this issue Jan 1, 2018 · 2 comments

Comments

@alfrekjv
Copy link

alfrekjv commented Jan 1, 2018

I am getting the following error when running my app on a CentOS 7 server.

Code for line 23 of users.js is as follows:

let salt = randtoken.generate(16)
0|server   | You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
0|server   | TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
0|server   |     at randomBytes (internal/crypto/random.js:44:11)
0|server   |     at Object.options.source (/root/facturas-api/node_modules/rand-token/index.js:61:18)
0|server   |     at Object.generate (/root/facturas-api/node_modules/rand-token/index.js:96:29)
0|server   |     at signup (/root/facturas-api/controllers/users.js:23:38)

Any ideas?

Update: Node Version is v9.3.0 (on v8.5.0 works like a charm)

@sehrope
Copy link
Owner

sehrope commented Jan 2, 2018

This is resolved by upgrading to the latest version of rand-token. It's due to a change in Node v9. See the recently closed issues for details.

@sehrope sehrope closed this as completed Jan 2, 2018
@alfrekjv
Copy link
Author

alfrekjv commented Jan 2, 2018

Thank you @sehrope!

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

2 participants