pbkdf2
pbkdf2 copied to clipboard
Incompatibility with rn-nodeify
trafficstars
When i Run my postinstall script, in a previous version of pbkdf2 (3.0.8), the rn-nodeify replace the "process.version" with the current version of node
In the actual version the rn-nodeify brokes the code

looks like rn-nodeify fixed it on their end
Got the same problem here STR:
- rn-nodeify --install --hack --yarn
- react-native bundle --entry-file index.tsx --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios
error SyntaxError: /Users/test/node_modules/parse-asn1/node_modules/pbkdf2/lib/default-encoding.js: Unexpected token (5:36)
3 | if (global.process && global.process.browser) {
4 | defaultEncoding = 'utf-8'
> 5 | } else if (global.process && global."v15.6.0") {
| ^
6 | var pVersionMajor = parseInt("v15.6.0".split('.')[0].slice(1), 10)
7 |
8 | defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'. Run CLI with --verbose flag for more details.
SyntaxError: /Users/test/node_modules/parse-asn1/node_modules/pbkdf2/lib/default-encoding.js: Unexpected token (5:36)
3 | if (global.process && global.process.browser) {
4 | defaultEncoding = 'utf-8'
> 5 | } else if (global.process && global."v15.6.0") {
| ^
6 | var pVersionMajor = parseInt("v15.6.0".split('.')[0].slice(1), 10)
7 |
8 | defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'
Same issue after node_modules/.bin/rn-nodeify --install --hack
have you upgraded rn-nodeify ?
I fixed this by following this comment solution
https://github.com/tradle/rn-nodeify/issues/102#issuecomment-817284939