npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.

5,302 views
Skip to first unread message

nadia ibrahim

unread,
Sep 29, 2023, 10:04:17 AM9/29/23
to Firebase Google Group
im trying to deploy my functions but keep getting this same error "npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing." 

ive updated my json and lock files, ive deleted them and reinstalled them too but i still keep getting this error and cant resolve itScreenshot 2023-09-29 at 12.31.58 pm.pngScreenshot 2023-09-29 at 12.32.07 pm.png

Arthur Thompson

unread,
Oct 24, 2023, 5:44:14 PM10/24/23
to fireba...@googlegroups.com
Hi,

One clarification question: does "npm install" or "npm ci" succeed if run from the functions directory?

On Fri, Sep 29, 2023 at 7:03 AM nadia ibrahim <nadia-...@hotmail.com> wrote:
im trying to deploy my functions but keep getting this same error "npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing." 

ive updated my json and lock files, ive deleted them and reinstalled them too but i still keep getting this error and cant resolve itScreenshot 2023-09-29 at 12.31.58 pm.pngScreenshot 2023-09-29 at 12.32.07 pm.png

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/9404f82f-cf07-41b4-9c1f-f0d1fecd7384n%40googlegroups.com.

Julio Imazio

unread,
Feb 13, 2024, 9:35:19 PM2/13/24
to Firebase Google Group
Same issue here, npm install and npm ci successfully working locally. 

Jeff Huleatt

unread,
Feb 26, 2024, 2:28:55 PM2/26/24
to Firebase Google Group
The first thing I'd recommend with an error like that is to delete your package-lock.json file and node_modules folder and do a clean `npm install` locally. If that doesn't help, one guess might be that the Node version you're running locally is different from the version you're deploying with, since the package-lock.json file has had a few different versions over the years (https://docs.npmjs.com/cli/v10/configuring-npm/package-lock-json#lockfileversion). Could you run `node -v` and `npm -v` and see if it matches the version of Node you're trying to deploy? For example, if you're deploying Node 18 functions, try to npm install with node 18 and its corresponding npm version 10 (list of npm and node versions: https://nodejs.org/en/about/previous-releases).

I hope that solves it! If not, it's probably worth filing a support ticket (https://firebase.google.com/support) for more in-depth troubleshooting.
Best,
Jeff 
Reply all
Reply to author
Forward
0 new messages