本文介绍了找不到变量:自我/无法安装 firebase的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I work on an App in React-Native / Expo and I can't install firebase.

C:UsersNils	est>npm install --save firebase
node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp WARN Using request for node-pre-gyp https download
Success: "C:UsersNils	est
ode_modulesgrpcsrc
odeextension_binary node-v57-win32-x64-unknowngrpc_node.node" is installed via remote
npm notice created a lockfile as package-lock.json. You should commit this file.
+ firebase@5.4.2
added 179 packages from 71 contributors, removed 369 packages, updated 643 packages and audited 20975 packages in 440.187s
found 0 vulnerabilities**

Error: React native is not installed. Please run npm install in your project directory.

C:UsersNils	est>npm install
added 260 packages from 160 contributors, updated 4 packages and audited     30579 packages in 121.866s
found 2 vulnerabilities (1 low, 1 high) run `npm audit fix` to fix them,     or `npm audit` for details**

I don't understand why it doesn't work, I don't even know where the problem is comming from ...

解决方案

For users creating new project with expo-cli or XDE, you will get red screen "Can’t Find Variable Self" after your first "yarn" or "npm install". This is because of new "whatwg-fetch" 3.0.0 published yesterday (https://www.npmjs.com/package/whatwg-fetch 23).So you just need to force dependency to previous version:"whatwg-fetch": "^2.0.4"It means put it in package.json as "dependency". Manually, with "yarn add whatwg-fetch@2.0.4." Or with "npm add whatwg-fetch@2.0.4".

Everything should now work like a charm.

Hope this helps ;p

Links:

这篇关于找不到变量:自我/无法安装 firebase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-18 15:53
查看更多