码迷,mamicode.com
首页 > 其他好文 > 详细

Unable to resolve module crypto

时间:2018-09-20 01:15:16      阅读:555      评论:0      收藏:0      [点我收藏+]

标签:The   tin   modules   node   ati   date   dom   react   save   

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

标签:The   tin   modules   node   ati   date   dom   react   save   

原文地址:https://www.cnblogs.com/qiyecao/p/9678326.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!