0

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'

4
  • 1
    What do the deployment logs say? (firebase functions:log) Commented Feb 20, 2022 at 1:22
  • 1
    Please delete those comments and add the information to the question itself as it looks messy and is hard to decipher. In addition, please include your package.json file. Commented Feb 20, 2022 at 1:30
  • I just installed npm install Easypost into the Functions folder to have it as dependency in firebase functions. The deploy worked now, thanks for the help.
    – Mars2024
    Commented Feb 20, 2022 at 1:32
  • 1
    @JedLancer I see you have your issue resolved now. Please post an answer as to how the issue was solved. That way, the community would have an answer to this question and it will be helpful for those, visiting it. Commented Feb 20, 2022 at 5:29

1 Answer 1

1

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.