node-email-verification
node-email-verification copied to clipboard
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. When createTempUser is called
This error occurs when you call the function events.js:174 throw er; // Unhandled 'error' event ^
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
at Object.randomBytes (internal/crypto/random.js:48:11)
at Object.options.source (/home/ubuntu/environment/se3316-mmccor26-lab5/node_modules/rand-token/index.js:60:25)
at Object.generate (/home/ubuntu/environment/se3316-mmccor26-lab5/node_modules/rand-token/index.js:95:29)
at /home/ubuntu/environment/se3316-mmccor26-lab5/node_modules/email-verification/index.js:286:58
at /home/ubuntu/environment/se3316-mmccor26-lab5/node_modules/mongoose/lib/model.js:4604:16
at /home/ubuntu/environment/se3316-mmccor26-lab5/node_modules/mongoose/lib/query.js:4351:12
at model.Query.Query._completeOne (/home/ubuntu/environment/se3316-mmccor26-lab5/node_modules/mongoose/lib/query.js:2054:12)
at Immediate.Query.base.findOne.call (/home/ubuntu/environment/se3316-mmccor26-lab5/node_modules/mongoose/lib/query.js:2116:10)
at Immediate.
This exact error is destroying me lol
Is there a answer for this? I am getting the same error
I'm getting it to...
This package is too old. It's not compatible with new node (v9 up). It is using old version of rand-token package when this issue was not fixed. Please take a look here for more information: https://github.com/sehrope/node-rand-token/issues/10
It is very simple fix I made by the fork here: https://github.com/datnguyen293/node-email-verification
I also created a pull request to original repository: https://github.com/whitef0x0/node-email-verification/pull/89
as a temporary solution you can:
- add "rand-token": "^0.4.0" to your
package.json
- use
npm shrinkwrap
- change in
npm-shrinkwrap.json
"email-verification": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/email-verification/-/email-verification-0.4.6.tgz",
"integrity": "sha1-DFRXJ/1onS12hWZvUbaLRMc5QkA=",
"requires": {
"mongoose": "~3.8.0",
"nodemailer": "^1.3.0",
"rand-token": "^0.4.0"
},
Aahh guys! After 3 hours I finally found it! rand-token doesn't work.
Opening the Issues tab to read this page oh wait.. - nevermind.