美文网首页
React-Native Bundle Error error

React-Native Bundle Error error

作者: zwebbin | 来源:发表于2021-02-21 18:28 被阅读0次

react native 打包失败,报错信息:

error SHA-1 for file /usr/local/lib/node_modules/react-native/node_modules/metro/src/lib/polyfills/require.js (/usr/local/lib/node_modules/react-native/node_modules/metro/src/lib/polyfills/require.js) is not computed. Run CLI with --verbose flag for more details.
ReferenceError: SHA-1 for file /usr/local/lib/node_modules/react-native/node_modules/metro/src/lib/polyfills/require.js (/usr/local/lib/node_modules/react-native/node_modules/metro/src/lib/polyfills/require.js) is not computed
    at DependencyGraph.getSha1 (/usr/local/lib/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph.js:258:13)
    at /usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/Transformer.js:211:26
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/Transformer.js:46:24)
    at _next (/usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/Transformer.js:66:9)
    at /usr/local/lib/node_modules/react-native/node_modules/metro/src/DeltaBundler/Transformer.js:71:7
    at new Promise (<anonymous>)

解决方法:

npm i -g react-native-cli@2.0.1

查看react native 版本:

react-native --version
react-native-cli: 2.0.1
react-native: 0.61.4

相关文章

网友评论

      本文标题:React-Native Bundle Error error

      本文链接:https://www.haomeiwen.com/subject/yriqfltx.html