Home > Mobile >  Firebase Functions deploy fails 'There was an error deploying Functions' with Easypost
Firebase Functions deploy fails 'There was an error deploying Functions' with Easypost

Time:02-21

Hello fellow world peace and Moonbase-36 residents, Deploying this firebase function Fails because I've added EASYPOST into the file. Do I need to create another functions file and deploy that to make this work?

// require('babel-polyfill');
const functions = require("firebase-functions");
const cors = require("cors");
const express = require("express");
const EasyPost = require('@easypost/api');
const EPapi = new EasyPost('YOURAPIKEY');

const app = express();
const stripe = require("stripe")("APIKEY");

As soon as I comment out the const EasyPost and const EPapi, the deploy works fine. But we need Easypost to work.

firebase functions:log Detailed stack trace: Error: Cannot find module '@easypost/api'

CodePudding user response:

OP resolved the issue by installing Easypost using npm install Easypost into the Functions folder to have it as dependency in firebase functions. The functions were deployed without errors.

  • Related