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

前端 未结 2 1394
萌比男神i
萌比男神i 2021-02-20 13:24

I am getting subject error while registering a simple Mean Application through http://localhost:3000/auth/register, that I have simply created using mean init comma

相关标签:
2条回答
  • 2021-02-20 13:32

    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'.

    0 讨论(0)
  • 2021-02-20 13:44

    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!)

    0 讨论(0)
提交回复
热议问题