Unable to resolve module crypto

Posted qiyecao

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

 

以上是关于Unable to resolve module crypto的主要内容,如果未能解决你的问题,请参考以下文章

Unable to resolve module `../res/images/ic_popular.png`

Unable to resolve module `react-native/Libraries/EventEmitter/EventEmitter`

rn0.57 bundling failed: Error: Unable to resolve module /../react-transform-hmr/lib/index.js

vscode下import语句报[eslint]unable to resolve path to module (import/no-resovled)

NodeJs的npm安装install报错:code ERESOLVE ERESOLVE unable to resolve dependency tree

tdengine jdbc连接报错: Unable to resolve FQDN