I initialized a new firebase project in my project. I added functions to my project and I am trying to deploy the default helloWorld function.
const functions = require("firebase-functions");
// // Create and deploy your first functions
// // https://firebase.google.com/docs/functions/get-started
//
exports.helloWorld = functions.https.onRequest((request, response) => {
functions.logger.info("Hello logs!", {structuredData: true});
response.send("Hello from Firebase!");
});
When I do this I get the following error saying it is missing a lot of packages I have never heard of.
i functions: updating Node.js 16 function helloWorld(us-central1)...
Build failed: ...c-fn@2.1.0 from lock file
npm ERR! Missing: error-ex@1.3.2 from lock file
npm ERR! Missing: json-parse-even-better-errors@2.3.1 from lock file
npm ERR! Missing: lines-and-columns@1.2.4 from lock file
npm ERR! Missing: is-arrayish@0.2.1 from lock file
npm ERR! Missing: find-up@4.1.0 from lock file
npm ERR! Missing: ansi-styles@5.2.0 from lock file
npm ERR! Missing: react-is@18.2.0 from lock file
npm ERR! Missing: kleur@3.0.3 from lock file
npm ERR! Missing: sisteransi@1.0.5 from lock file
npm ERR! Missing: is-core-module@2.11.0 from lock file
npm ERR! Missing: path-parse@1.0.7 from lock file
npm ERR! Missing: supports-preserve-symlinks-flag@1.0.0 from lock file
npm ERR! Missing: resolve-from@5.0.0 from lock file
npm ERR! Missing: buffer-from@1.1.2 from lock file
npm ERR! Missing: escape-string-regexp@2.0.0 from lock file
npm ERR! Missing: char-regex@1.0.2 from lock file
npm ERR! Missing: glob@7.2.3 from lock file
npm ERR! Missing: is-number@7.0.0 from lock file
npm ERR! Missing: picocolors@1.0.0 from lock file
npm ERR! Missing: convert-source-map@1.9.0 from lock file
npm ERR! Missing: makeerror@1.0.12 from lock file
npm ERR! Missing: tmpl@1.0.5 from lock file
npm ERR! Missing: yallist@3.1.1 from lock file
npm ERR! Missing: ansi-styles@3.2.1 from lock file
npm ERR! Missing: escape-string-regexp@1.0.5 from lock file
npm ERR! Missing: supports-color@5.5.0 from lock file
npm ERR! Missing: color-convert@1.9.3 from lock file
npm ERR! Missing: color-name@1.1.3 from lock file
npm ERR! Missing: has-flag@3.0.0 from lock file
npm ERR! Missing: locate-path@5.0.0 from lock file
npm ERR! Missing: argparse@1.0.10 from lock file
npm ERR! Missing: sprintf-js@1.0.3 from lock file
npm ERR! Missing: p-locate@4.1.0 from lock file
npm ERR! Missing: p-limit@2.3.0 from lock file
npm ERR! Missing: p-try@2.2.0 from lock file
npm ERR! Missing: cliui@8.0.1 from lock file
npm ERR! Missing: yargs-parser@21.1.1 from lock file
npm ERR! Missing: locate-path@5.0.0 from lock file
npm ERR! Missing: p-locate@4.1.0 from lock file
npm ERR! Missing: p-limit@2.3.0 from lock file
npm ERR!
npm ERR! Clean install a project
npm ERR!
npm ERR! Usage:
npm ERR! npm ci
npm ERR!
npm ERR! Options:
npm ERR! [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
npm ERR! [-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
npm ERR! [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
npm ERR! [--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
npm ERR! [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
npm ERR! [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
npm ERR! [-ws|--workspaces] [--include-workspace-root] [--install-links]
npm ERR!
npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
npm ERR!
npm ERR! Run "npm help ci" for more info
npm ERR! A complete log of this run can be found in:
npm ERR! /www-data-home/.npm/_logs/2023-02-28T21_49_46_615Z-debug-0.log; Error ID: beaf8772
Functions deploy had errors with the following functions:
helloWorld(us-central1)
I installed the firebase-functions package, also let firebase install it's packages in the setup when initializing. I tried removing node_modules, remove cache, remove lock, reinstalling. I tried removing firebase from my project and reinitializing it. I tried changing my Node version.
I am really clueless.
Hope someone can help me!
Thanks!