【发布时间】:2022-09-30 02:38:46
【问题描述】:
使用 React Native Expo V4.13.0,导入 web3 V1.6.1 模块,我收到以下错误:
Unable to resolve module crypto from /Users/black/Desktop/test/node_modules/web3-eth-accounts/lib/index.js: crypto could not be found within the project or in these directories:
node_modules/web3-eth-accounts/node_modules
node_modules
../../node_modules
如果您确定该模块存在,请尝试以下步骤:
- 清空守望者手表:watchman watch-del-all
- 删除节点模块
- 运行 yarn install 重置 Metro 的缓存: yarn start --reset-cache
- 删除缓存:rm -rf /tmp/metro-*
24 | var Method = require(\'web3-core-method\'); 25 | var Account = require(\'eth-lib/lib/account\'); 26 | var cryp = (typeof global === \'undefined\') ? require(\'crypto-browserify\') : require(\'crypto\'); | ^ 27 | var scrypt = require(\'scrypt-js\'); 28 | var uuid = require(\'uuid\'); 29 | var utils = require(\'web3-utils\');`昨天我更新了 expo 的版本,它不再工作了,在它工作正常之前。
有没有人有同样的问题?
标签: react-native expo web3js