[未处理的承诺拒绝:TypeError:未定义不是对象(正在评估'Expo.Permissions.getAsync')]

时间:2019-11-16 23:42:07

标签: expo

小吃-在这里,我创建了一个小吃,该小吃复制了错误:https://snack.expo.io/S1Kc6WAir

我正在这样导入我的权限

import * as Permissions from 'expo-permissions';

这就是我的package.json的样子

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "expo": "^35.0.0",
    "react": "16.8.3",
    "react-dom": "16.8.3",
    "react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
    "react-native-gesture-handler": "~1.3.0",
    "react-native-reanimated": "~1.2.0",
    "react-native-screens": "~1.0.0-alpha.23",
    "react-native-web": "^0.11.7",
    "react-navigation": "^4.0.10",
    "react-navigation-stack": "^1.10.3"
  },
  "devDependencies": {
    "babel-preset-expo": "^7.1.0"
  },
  "private": true
}

这也是我的包锁json

"expo-permissions": {
      "version": "7.0.0",
      "resolved": "https://registry.npmjs.org/expo-permissions/-/expo-permissions-7.0.0.tgz",
      "integrity": "sha512-C+qyVz+pdZO4YpVR2HSC3gsBZg0Qb8brCFgzmDmWcAtgrOiHClaLPdhI2XtQuGh8ubXcKPUGZp++UCEGiG0Jxg=="
    }

但是我仍然不知道如何解决该错误。感谢您的帮助。

在这种情况下,我尝试通过运行 expo install expo-permissions 来安装权限,但这又使我恢复了 spawn yarnpkg ENOENT ,所以我改用了 npm install expo-permissions ,这似乎工作正常。

0 个答案:

没有答案