Node-jsonwebtoken: Unable to resolve jws/lib/sign-stream.js

Created on 29 Jun 2016  路  9Comments  路  Source: auth0/node-jsonwebtoken

Just installed [email protected] and required the module, then immediately got the error "Cannot find node_modules/jws/lib/sign-stream.js"

Context: Running this on React Native

Most helpful comment

According to this https://github.com/facebook/react-native/issues/3874#issuecomment-167150393

Node core modules cannot be used inside React Native as it's a completely different environment

I only needed to decode the token and switched to using this https://github.com/auth0/jwt-decode

In any case, this issue can be closed. It isn't really applicable to node-jsonwebtoken itself.

All 9 comments

I am not familiar with React Native, but the file is there. Try rm -rf node_modules && npm i

Having the same issue as @calclavia. I tried reinstalling the node module but still no luck. It seems like several dependencies are missing. I manually installed stream, only to see that more modules were missing.

@jfromaniello Tried that as well. Did not fix it.

Any update on this issue? Still having this problem...

Just got this problem today trying to use 7.2.1.

Using React-Native 0.41

According to this https://github.com/facebook/react-native/issues/3874#issuecomment-167150393

Node core modules cannot be used inside React Native as it's a completely different environment

I only needed to decode the token and switched to using this https://github.com/auth0/jwt-decode

In any case, this issue can be closed. It isn't really applicable to node-jsonwebtoken itself.

Is there any React-Native alternative that can performsign() with HMAC SHA256?
Can't find any that would work.

@anders-g-hansen could you please let me know how you managed to make it work with jwt-decode https://github.com/auth0/node-jsonwebtoken/issues/221#issuecomment-283108676

You can try this module react-native-pure-jwt

Was this page helpful?
0 / 5 - 0 ratings

Related issues

itamarwe picture itamarwe  路  3Comments

shea256 picture shea256  路  3Comments

cope picture cope  路  4Comments

samholmes picture samholmes  路  5Comments

svnty picture svnty  路  3Comments