没有升级到Expo 3.11.5

时间:2020-01-13 06:13:10

标签: react-native expo upgrade

我在MacOS High Sierra 10.13.6上使用以下命令来升级Expo CLI:

npm uninstall -g expo-cli --save

然后

npm install -g expo-cli --save

但它仍然说:

┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                                                                                          │
│   There is a new version of expo-cli available (3.11.5).                                                                                 │
│   You are currently using expo-cli 3.4.1                                                                                                 │
│   Install expo-cli globally using the package manager of your choice; for example: `npm install -g expo-cli` to get the latest version   │
│                                                                                                                                          │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

发行时

expo start

从我的根目录开始。

要注意的是,在安装时,这是日志:

npm WARN @expo/image-utils@0.2.11 requires a peer of sharp-cli@^1.10.0 but none is installed. You must install peer dependencies yourself.

+ expo-cli@3.11.5
added 1572 packages from 929 contributors and updated 1 package in 400.813s

我的package.json:

{
  "name": "NativebaseKitchenSink",
  "version": "2.12.0",
  "private": true,
  "devDependencies": {
    "babel-eslint": "7.2.3",
    "eslint": "4.4.1",
    "eslint-plugin-flowtype": "2.35.0",
    "eslint-plugin-import": "2.7.0",
    "eslint-plugin-jsx-a11y": "6.0.2",
    "eslint-plugin-prettier": "2.1.2",
    "eslint-plugin-react": "7.1.0",
    "eslint-plugin-react-native": "3.0.1",
    "flow-bin": "0.78.0",
    "flow-typed": "2.5.1",
    "husky": "0.14.3",
    "jest": "24.1.0",
    "metro-react-native-babel-preset": "0.52.0",
    "prettier": "1.5.3",
    "react-test-renderer": "16.6.3"
  },
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "postinstall": "jetify",
    "and_bundle": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res"
  },
  "jest": {
    "preset": "react-native",
    "transformIgnorePatterns": [
      "node_modules/(?!(react-native|lottie-react-native|expo|react-native-maps|react-native-svg|react-native-branch|native-base-shoutem-theme|react-native-easy-grid|react-native-drawer|react-native-vector-icons|react-native-keyboard-aware-scroll-view|react-native-swiper|react-navigation|native-base|@expo|react-native-scrollable-tab-view|react-native-simple-modal|react-native-iphone-x-helper)/)"
    ]
  },
  "dependencies": {
    "color": "1.0.3",
    "expo": "^35.0.0",
    "expo-cli": "^3.4.1",
    "lodash": "4.17.10",
    "moment": "2.13.0",
    "native-base": "2.12.1",
    "prop-types": "^15.6.2",
    "react": "16.9.0",
    "react-base": "^0.2.0",
    "react-native": "0.59.10",
    "react-native-new-version": "0.61.5",
    "react-native-gesture-handler": "^1.0.15",
    "react-native-vector-icons": "^6.3.0",
    "react-navigation": "3.3.0",
    "scheduler": "^0.12.0",
    "styled-components": "^3.4.5"
  }
}

为什么?

3 个答案:

答案 0 :(得分:0)

您正在使用Windows吗?打开任务管理器,然后杀死adb.exe, 然后以管理员身份运行终端,然后运行:npm install -g expo-cli

或者,重新启动计算机,然后以管理员身份运行终端,然后运行:npm install -g expo-cli

答案 1 :(得分:0)

尝试删除node_modules,并确保expo-cli未在本地而不是在全局安装在package.json中。

然后在“哪个博览会”上执行此命令

答案 2 :(得分:0)

我在package.json中更新了以下依赖项:

"expo-cli": "3.11.5",

我已删除节点模块并发出:

npm install 
再次