运行 新电脑上的 React Native 应用
Running a react native app on a new computer
我一直在开发一个新的 react-native 应用程序。从 Expo 开始,然后使用 Expo。
我在源代码管理中有这个东西,刚刚在 mac 上打开它。当我这样做 npm install
时,我收到以下警告
npm WARN react-native-branch@2.0.0-beta.3 requires a peer of react@>=15.4.0 but none was installed.
npm WARN lottie-react-native@1.1.1 requires a peer of react@>=15.3.1 but none was installed.
npm WARN react-native-maps@0.15.2 requires a peer of react@>=15.4.0 but none was installed
npm WARN react-static-container@1.0.1 requires a peer of react@^0.13.0 || ^0.14.0 || ^15.0.0 but none was installed.
npm WARN react-test-renderer@15.4.2 requires a peer of react@^15.4.2 but none was installed.
npm WARN react-dom@15.6.1 requires a peer of react@^15.6.1 but none was installed.
当我执行 npm start
时,显示了条形码,但随后构建花费了 5 分钟,未能在 phone 上加载(超时)。
我更改了空白文件以刺激重建。这立即发生了,但是在 phone 上出现了错误..
16:23:59: Warning: Failed prop type: Invalid prop `flex` of type `function` supplied to `View`, expected `number`.
Bad object: {}
我对包 management/react/react-native 有什么误解吗?它工作的 machine 是一台 PC,不工作的是 mac mini。
我的package.json是这样的
{
"name": "super-app",
"version": "0.1.0",
"private": true,
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"jest-react-native": "^18.0.0",
"react-test-renderer": "~15.4.1",
"lodash.isequal": "^4.5.0",
"react-addons-pure-render-mixin": "^15.4.2",
"react-dom": "^15.4.2",
"react-native-experimental-navigation": "0.26.x",
"react-native-tabs": "^1.0.9",
"react-static-container": "1.0.1",
"react-native-scripts": "0.0.40",
"jest-expo": "~18.0.0"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"apsl-react-native-button": "^3.0.2",
"expo": "^18.0.3",
"react": "16.0.0-alpha.12",
"react-native": "0.45.0",
"react-native-button": "^1.8.2",
"react-native-drawer": "^2.3.0",
"react-native-router-flux": "^3.39.1"
}
}
然后 brew install yarn
快乐的日子。
仍然迷失在这个生态系统中未知活动部件的网络中!
我一直在开发一个新的 react-native 应用程序。从 Expo 开始,然后使用 Expo。
我在源代码管理中有这个东西,刚刚在 mac 上打开它。当我这样做 npm install
时,我收到以下警告
npm WARN react-native-branch@2.0.0-beta.3 requires a peer of react@>=15.4.0 but none was installed.
npm WARN lottie-react-native@1.1.1 requires a peer of react@>=15.3.1 but none was installed.
npm WARN react-native-maps@0.15.2 requires a peer of react@>=15.4.0 but none was installed
npm WARN react-static-container@1.0.1 requires a peer of react@^0.13.0 || ^0.14.0 || ^15.0.0 but none was installed.
npm WARN react-test-renderer@15.4.2 requires a peer of react@^15.4.2 but none was installed.
npm WARN react-dom@15.6.1 requires a peer of react@^15.6.1 but none was installed.
当我执行 npm start
时,显示了条形码,但随后构建花费了 5 分钟,未能在 phone 上加载(超时)。
我更改了空白文件以刺激重建。这立即发生了,但是在 phone 上出现了错误..
16:23:59: Warning: Failed prop type: Invalid prop `flex` of type `function` supplied to `View`, expected `number`.
Bad object: {}
我对包 management/react/react-native 有什么误解吗?它工作的 machine 是一台 PC,不工作的是 mac mini。
我的package.json是这样的
{
"name": "super-app",
"version": "0.1.0",
"private": true,
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"jest-react-native": "^18.0.0",
"react-test-renderer": "~15.4.1",
"lodash.isequal": "^4.5.0",
"react-addons-pure-render-mixin": "^15.4.2",
"react-dom": "^15.4.2",
"react-native-experimental-navigation": "0.26.x",
"react-native-tabs": "^1.0.9",
"react-static-container": "1.0.1",
"react-native-scripts": "0.0.40",
"jest-expo": "~18.0.0"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"apsl-react-native-button": "^3.0.2",
"expo": "^18.0.3",
"react": "16.0.0-alpha.12",
"react-native": "0.45.0",
"react-native-button": "^1.8.2",
"react-native-drawer": "^2.3.0",
"react-native-router-flux": "^3.39.1"
}
}
然后 brew install yarn
快乐的日子。
仍然迷失在这个生态系统中未知活动部件的网络中!