我在已弃用的依赖项中使用babel-preset-react-native
,而不是“ metro-react-native-babel-preset”:现在正在使用“ ^ 0.47.0”。因此,我使用以下代码更新了该文件,同时也更新了.babelrc
文件:
{
"presets": ["module:metro-react-native-babel-preset"]
}
上面的代码解决了我在此链接error: bundling failed: TypeError: Cannot read property 'bindings' of null中遇到的问题,但是在加载100%之后,该应用会显示不同的红屏,我在下面共享了此信息:
错误日志:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using npm@5.6.0
3 info using node@v8.11.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle ExampleApp@0.0.1~prestart: ExampleApp@0.0.1
6 info lifecycle ExampleApp@0.0.1~start: ExampleApp@0.0.1
7 verbose lifecycle ExampleApp@0.0.1~start: unsafe-perm in lifecycle true
8 verbose lifecycle ExampleApp@0.0.1~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/manish/Desktop/Practice/donut/node_modules/.bin:/home/manish/bin:/home/manish/.local/bin:/opt/maven/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/java/jdk1.8.0_161/bin:/snap/bin:/home/manish/Android/Sdk/tools:/home/manish/Android/Sdk/platform-tools:/opt/maven/bin:/opt/android-studio/gradle/gradle-4.5/bin:/android-studio/gradle/gradle-4.5/bin:/home/manish/Android/Sdk/tools:/home/manish/Android/Sdk/platform-tools:/usr/local/apache-maven-3.5.2/bin:/opt/android-studio/gradle/gradle-4.5/bin:/android-studio/gradle/gradle-4.5/bin
9 verbose lifecycle ExampleApp@0.0.1~start: CWD: /home/manish/Desktop/Practice/donut
10 silly lifecycle ExampleApp@0.0.1~start: Args: [ '-c',
10 silly lifecycle 'node node_modules/react-native/local-cli/cli.js start' ]
11 silly lifecycle ExampleApp@0.0.1~start: Returned: code: 137 signal: null
12 info lifecycle ExampleApp@0.0.1~start: Failed to exec start script
13 verbose stack Error: ExampleApp@0.0.1 start: `node node_modules/react-native/local-cli/cli.js start`
13 verbose stack Exit status 137
13 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid ExampleApp@0.0.1
15 verbose cwd /home/manish/Desktop/Practice/donut
16 verbose Linux 4.15.0-34-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v8.11.3
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 137
22 error ExampleApp@0.0.1 start: `node node_modules/react-native/local-cli/cli.js start`
22 error Exit status 137
23 error Failed at the ExampleApp@0.0.1 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 137, true ]
package.json
{
"name": "ExampleApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"amazon-cognito-identity-js": "^1.31.0",
"aws-sdk": "^2.177.0",
"aws4-react-native": "0.0.2",
"axios": "^0.16.2",
"babel-preset-es2015": "^6.24.1",
"google-libphonenumber": "^2.0.9",
"react": "16.0.0-alpha.12",
"react-native": "0.57.1",
"react-native-camera": "^0.10.0",
"react-native-display": "^1.0.8",
"react-native-doc-viewer": "^2.6.3",
"react-native-exit-app": "^1.0.0",
"react-native-fetch-blob": "^0.10.8",
"react-native-file-picker": "0.0.8",
"react-native-file-provider": "^1.1.0",
"react-native-fs": "^2.5.1",
"react-native-google-analytics-bridge": "^5.6.1",
"react-native-image-gallery": "^2.1.4",
"react-native-image-resizer": "^1.0.0",
"react-native-immersive": "^1.1.0",
"react-native-indicators": "^0.10.0",
"react-native-localization": "^0.2.1",
"react-native-material-textfield": "^0.10.0",
"react-native-material-ui": "^1.13.0",
"react-native-mime-types": "^2.2.1",
"react-native-orientation": "^3.1.3",
"react-native-share": "^1.0.23",
"react-native-uuid": "^1.4.9",
"react-native-vector-icons": "^4.4.2",
"react-navigation": "^1.0.3",
"react-side-effect": "^1.1.3",
"realm": "^2.0.0"
},
"devDependencies": {
"@babel/preset-env": "^7.1.0",
"@babel/runtime": "^7.0.0",
"babel-jest": "20.0.3",
"jest": "20.0.4",
"metro-react-native-babel-preset": "^0.47.0",
"react-test-renderer": "16.0.0-alpha.12",
"schedule": "^0.4.0"
},
"jest": {
"preset": "react-native"
}
}
什么是错误,为什么会出现此错误?我想念什么吗?