我正在尝试使用以下语法在我的反应应用程序中导入 firebase:
import firebase from 'firebase/index';
但我面临以下问题:
./src/App.js
Module not found: Can't resolve 'firebase/index' in '/home/neosoft/Documents/react_projects/urup_dashboard/src'
我不确定是什么问题,因为我是一个反应新手。
更新 我注意到一件奇怪的事情。上面的 import 语法在 ubuntu 14.04 中运行良好。该问题在 ubuntu 16.04 中面临。我不确定其他版本的 ubuntu。
原文由 Vishal 发布,翻译遵循 CC BY-SA 4.0 许可协议
您需要从项目文件夹中运行
npm install firebase