在世博会上发表,依赖地狱

时间:2018-03-29 13:44:10

标签: expo

我在Expo IDE中遇到了这两个错误:

警告:您使用的是npm 5.6.0版。此版本可能存在错误,使用风险自负。我们建议使用4.6.1版本。

警告:package.json中的Expo版本与清单中的sdkVersion不匹配。

警告:“反应”同伴依赖缺失。在C:\ users \ matt \ sites \ rg-calendar中运行npm ls以查看完整警告。 如果项目正在运行,请在C:\ users \ matt \ sites \ rg-calendar中运行npm install并重新启动。

当我跑npm ls时,我遇到了一大堆缺失的软件包,我正在运行npm install,但我只是得到了未满足的依赖性错误。

我的app.json文件是:

{
  "expo": {
   "name": "RGUC",
   "icon": "./img/calendarIcon.png",
   "version": "1.0.0",
   "slug": "rguc-calendar",
   "sdkVersion": "21.0.0",
   "ios": {
     "bundleIdentifier": "com.rguc.calendar"
   },
   "android": {
     "package": "com.rguc.calendar"
   }
  }
}

我的package.json中有相同的react-native版本:

{
  "name": "rgcalendar",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "babel-eslint": "^8.2.2",
    "eslint": "^4.18.2",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-plugin-import": "^2.9.0",
    "eslint-plugin-jsx-a11y": "^6.0.3",
    "eslint-plugin-react": "^7.7.0",
    "flow-bin": "^0.69.0",
    "jest-expo": "21.0.0",
    "react-native-scripts": "1.8.1",
    "react-test-renderer": "16.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",
    "lint": "eslint --fix *.js",
    "flow": "flow"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "expo": "^21.0.0",
    "react": "16.0.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-21.0.2.tar.gz",
    "react-native-calendars": "^1.16.1",
    "react-native-fontawesome": "^5.7.0",
    "react-native-vector-icons": "^4.5.0",
    "react-navigation": "^1.0.3",
    "react-navigation-redux-helpers": "^1.0.1",
    "react-redux": "^5.0.6",
    "redux": "^3.7.2",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.2.0"
  }
}

我正在使用NVM:

    9.5.0
  * 8.10.0 (Currently using 64-bit executable)
    6.11.1
    4.6.1
    4.4.0

如何发布我的世博项目?

2 个答案:

答案 0 :(得分:0)

对于降级NPM,请使用以下命令:npm install -g npm@4它将安装4.6.1(此刻)。

目前的世博会版本是26. Expo 21是基于react-native 0.48而反应16.0.0所以也许你有一些与那个版本不兼容的模块。

对于未满足的依赖项,请尝试以下操作:删除(或移动)node_modules文件夹并运行npm install again并尝试npm cache clean

也许upgrading your react versions也可以解决问题。

最后,对于发布,你可以使install the Expo XDE更容易。当然,首先你必须摆脱任何编译错误(而不是警告)才能发布你的世博项目。

答案 1 :(得分:0)

根据我的经验,我可以说npm 5.6.0版存在问题。使用npm 4.6.1,其完全稳定。您可以通过npm uninstall npm@5.6.0 && npm install npm@4.6.1进行操作。之后,执行npm -v以查看是否显示4.6.1或仍为5.6.0。如果可行,您将看到4.6.1而不是5.6.0。让我知道这是否可以解决您的问题。

要发布Expo项目,只需按照此链接中的步骤进行操作-> https://docs.expo.io/versions/v19.0.0/workflow/building-standalone-apps

相关问题