util.crypto.lib. randomBytes is not a function : aws cognito js throws error on authentication

浪子不回头ぞ 提交于 2019-12-04 07:12:54

Update (12 Jan 2018):

The amazon-cognito-identity-js devs have locked the aws-sdk version in v1.31.0, so you don't have to downgrade aws-sdk anymore, just upgrade the package:

npm install amazon-cognito-identity-js@1.31.0 --save

Looks like there's a problem with the aws-sdk package. It's the dependency of the amazon-cognito-identity-js package that you're using.

You could try to downgrade it by running:

npm install aws-sdk@2.177.0 --save

Downgrading is the only option right now. I faced this error for hours, unable to figure out the actual issue. I guess AWS should maintain proper versioning and push only stable versions. :\ aws-sdk 2.177.0 works just fine. You can use the angular-2-cognito boilerplate by AWS.

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