react-native bundle, error SHA-1 for file XX is not computed.

来源:14-6 打包发布React Native项目【收获果实】

Capricorncd

2020-05-03

"react-native": "^0.62.2",

运行命令

react-native bundle --platform ios --entry-file index.js --bundle-output ./buidles/main.jsbundle --assets-dest ./bundles  --dev false

Error

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.
写回答

1回答

Capricorncd

提问者

2020-05-03

package.json > script 追加脚本,使用 npm run bundle-ios

手动创建文件夹 `dist`,或直接编译文件放到`ios/`目录下

```

"scripts": {
...
 "bundle-ios": "node node_modules/react-native/local-cli/cli.js bundle --entry-file index.js --platform ios --dev false --bundle-output ./dist/main.jsbundle --assets-dest ./dist"
},

```

0
0

RN入门到进阶,打造高质量上线App

解锁React Native开发应用新姿势,React Native新版本热门技术

3144 学习 · 3241 问题

查看课程