当前位置:首页 > Windows程序 > 正文

getBlacklistRE () { return blacklist([/react-native\/local-

2024-03-31 Windows程序

1 进入项目更新npm 正如jerry指出的那样,,这是NPM中的一个错误。此刻有一个修复措施可用。您可以使用更新NPM npm i -g npm删除了React Native,npm remove --save react-native并从头安置了RN npm i --save react-native





2 error: bundling failed: Error: While resolving module `react-native-vector-icons/MaterialIcons`, the Haste package `react-native-vector-icons` was found. However the module `MaterialIcons` could not be found within the package. Indeed, none of these files exist: * `/Users/user/my-app/node_modules/react-native/local-cli/core/__fixtures__/files/MaterialIcons(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)` * `/Users/user/my-app/node_modules/react-native/local-cli/core/__fixtures__/files/MaterialIcons/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`


第一步

在rn-cli.config.js在我的项目根目录中为此使用RN 0.52.0解决要领

const blacklist = require(‘metro/src/blacklist‘) module.exports = { getTransformModulePath () { return require.resolve(‘react-native-typescript-transformer‘) }, getSourceExts () { return [‘ts‘, ‘tsx‘] }, getBlacklistRE () { return blacklist([/react-native\/local-cli\/core\/__fixtures__.*/]) }, }

第二步
rm ./node_modules/react-native/local-cli/core/__fixtures__/files/package.json

退出措施 从头运行

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/34972.html

Jm-杰米博客Jamie
草根站长的技术交流乐园!IT不会不要紧快来好好学习吧!
  • 20786文章总数
  • 7494589访问次数
  • 建站天数
  • 友情链接