找不到模块:无法解析"firebase/index" [英] Module not found: Can't resolve 'firebase/index'

查看:50
本文介绍了找不到模块:无法解析"firebase/index"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下语法在我的React应用程序中导入Firebase:

I am trying to import firebase in my react app, using the following syntax:

从"firebase/index"导入firebase;

但是我面临以下问题:

<代码> ./src/App.js找不到模块:无法解析"/home/neosoft/Documents/react_projects/urup_dashboard/src"中的"firebase/index"

我不确定是什么问题,因为我是新手.

I am not sure what is the issue, as I am a newbie to react.

更新我注意到一件奇怪的事.上面的导入语法在ubuntu 14.04中工作正常.该问题在ubuntu 16.04中面临.我不确定其他版本的ubuntu.

UPDATE I have noticed a strange thing. The above syntax of import works fine in ubuntu 14.04. The issue is faced in ubuntu 16.04. I am not sure about other versions of ubuntu.

推荐答案

您需要从项目文件夹中运行 npm install firebase

You need to run npm install firebase from your project folder

这篇关于找不到模块:无法解析"firebase/index"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆