TypeError: The “digest” argument is required and must not be undefined

烈酒焚心 提交于 2019-12-04 02:09:58
Shadowfool

Per the crypto.pbkdf2Sync method you are missing the final argument which is digest, thus the error being displayed.

crypto.pbkdf2

Also with further investigation you can see that the digest argument was required in Node v6.0.

The previous default seems to have been 'sha1'.

This could also be caused by the wrong version of node / running a version that has calls that are not supported in the version of node that you have active

My Experience: My team has an application that requires Node 6.10.0. Sometimes I forget to switch to this version of node and run the latest code under 8.6.0 and I receive the same error. As soon as I swap back to 6.10.0 the website will allow me to login.

(I can see that the accepted answer also mentions this, but I wanted to add a more obvious answer in case it helps someone out there!)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!