我一直在为我的应用程序使用Firebase云存储,所以我在server.js文件中需要'firebase / storage',如下所示。代码昨晚工作正常,但是当我今天早上尝试“node server.js”时,我不断收到模块错误:
Error: Cannot find module 'firebase/storage'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/ubuntu/workspace/app.js:10:15)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
以下是server.js代码的片段:
var express = require('express');
var logger = require('morgan')
var bodyParser = require('body-parser')
var app = express();
var path = require('path');
var formidable = require('formidable');
var fs = require('fs');
var admin = require('firebase-admin')
var storage = require('firebase/storage')
我已经在fireabase应用程序中初始化并在我的html和js中对firebase存储进行了正确的引用,否则我的代码将在昨晚无效。为什么我现在收到此错误?
答案 0 :(得分:3)