Unable to resolve module crypto

Add rn-nodeify to your devDependencies in package.json:

"devDependencies": {
"rn-nodeify": "^6.0.1"
}

Add the following to the scripts section of the same file:

"scripts": {

"postinstall": "node_modules/.bin/rn-nodeify --install crypto --hack"
}
npm i --save react-native-crypto
# install peer deps
npm i --save react-native-randombytes
react-native link react-native-randombytes
# install latest rn-nodeify
npm i --save-dev mvayngrib/rn-nodeify
# install node core shims and recursively hack package.json files
# in ./node_modules to add/update the "browser"/"react-native" field with relevant mappings
./node_modules/.bin/rn-nodeify --hack --install
上一篇:egret编译 FATAL ERROR: CALL_AND_RETRY_0 Allocation failed process out of memory解决


下一篇:fzu Problem 2148 Moon Game(几何 凸四多边形 叉积)