Firebase功能在本地配置

时间:2019-10-23 17:26:40

标签: reactjs firebase

在我的React App中,我已经设置了所有变量,并可以使用

正确获取它们。
firebase functions:config:get

只要将firebase-functions导入我的代码中,我就会收到错误

ERROR in ./node_modules/firebase-functions/lib/apps.js
Module not found: Error: Can't resolve 'firebase-admin' in '/Users/pathtomyproject/node_modules/firebase-functions/lib'
 @ ./node_modules/firebase-functions/lib/apps.js 24:17-42
 @ ./node_modules/firebase-functions/lib/index.js
 @ ./environment/variables.js
 @ ./src/components/login/LoginForm.js
 @ ./src/components/login.js
 @ ./src/routers/AppRouter.js
 @ ./src/app.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app.js

ERROR in ./node_modules/firebase-functions/lib/providers/firestore.js
Module not found: Error: Can't resolve 'firebase-admin' in '/Users/pathtomyproject/node_modules/firebase-functions/lib/providers'
 @ ./node_modules/firebase-functions/lib/providers/firestore.js 24:17-42
 @ ./node_modules/firebase-functions/lib/index.js
 @ ./environment/variables.js
 @ ./src/components/login/LoginForm.js
 @ ./src/components/login.js
 @ ./src/routers/AppRouter.js
 @ ./src/app.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app.js

ERROR in bundle.js from UglifyJs
Unexpected token: name (Change) [./node_modules/firebase-functions/lib/cloud-functions.js:35,0][bundle.js:128825,6]

其他人是否经历过此事或知道如何解决?预先感谢

0 个答案:

没有答案