react-native不生成android的文件
我可能读了这个问题超过了几个小时,我找不到任何有用的东西。 我很新的反应母语和我之前安装了这个包,一切都很好: 反应母语 - 弹出式对话框react-native不生成android的文件
在那之后,我开始的错误,然后,我用删除的包npm卸载命令。错误提示:
To resolve try the following:
1. Clear watchman watches: `watchman watch-del-all`.
2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
3. Reset packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cache`.
嗯,我做了这个,现在我不能让项目再次工作。我得到这个错误:
Loading dependency graph, done.
Bundling `index.android.js`
Transforming modules ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░ 86.0% (575/620)...(node:12608) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1626): UnableToResolveError: Unable to resolve module react-native/Libraries/Components/StaticContainer.react from D:\Code\Mobile\node_modules\native-base\dist\src\basic\Tabs\SceneComponent.js: Module does not exist in the module map or in these directories:
D:\Code\Mobile\node_modules\react-native\Libraries\Components
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
1. Clear watchman watches: `watchman watch-del-all`.
2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
3. Reset packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cache`.
(node:12608) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process Bundling `index.android.js`
我都懂没有找到模块StaticContainer.react,但我并没有取得在本土基地东西。我再次尝试删除node_modules和clean-cache,但没有奏效。
我的package.json是:
{
"name": "MyProject",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"native-base": "^2.0.10",
"react": "15.4.2",
"react-native": "0.43.0",
"react-native-fcm": "^6.2.0",
"react-native-localization": "^0.1.29",
"react-native-popup-dialog": "^0.7.22",
"react-native-tabs": "^1.0.9",
"react-native-vector-icons": "^4.0.0",
"react-navigation": "^1.0.0-beta.6"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"react-test-renderer": "15.4.2"
},
"jest": {
"preset": "react-native"
}
}
有人能帮助我吗?
感谢, 若昂
本土基队改变了依赖来自: "react": "^15.4.2"
至"react": "^16.0.0-alpha.3"
和 "react-native": "^0.39.2"
到"react-native": "^0.43.0"
当您进行重新安装原生基rm -rf node_modules && npm install
它可能安装较新代码库与上述变化。
因此,无论您更新到新版本,或者如果你不能因为担心其他依赖升级,手动更改的模块文件夹:
打开SceneComponent.js
在~/node_modules/native-base/dist/src/basic/Tabs/
和变更线从6
var StaticContainer=require('react-native/Libraries/Components/StaticContainer.react');
到
var StaticContainer=require('react-native/Libraries/Components/StaticContainer');
不要忘了执行npm start -- --reset-cache
尼斯,我做出了正确的更新和工作就像一个魅力。感谢您的解释! –
不客气。请记住,第二个选项只是一个快速修复。最终,您需要逐个更新所有库。 ;-) –