I have been facing a build error since yesterday where package.json and package-lock.json is in sync but npm-ci is not running the build . I lietrally fedup , the agent is going back and forth .
I really need some help with this .
I have been facing a build error since yesterday where package.json and package-lock.json is in sync but npm-ci is not running the build . I lietrally fedup , the agent is going back and forth .
I really need some help with this .
Hello, Ashok
Did you manage to find a lasting solution to this issue?
Stuck here too.
Are you facing this issue with the Prototyper or the Next.js template?
No , I have actually built complete new app . Now i facing with permission issues ![]()
I am using prototyper , I have used npm install to build package-lock.json
This is a classic, super-frustrating npm issue. It’s almost guaranteed that npm ci is failing because it’s detecting a subtle inconsistency between your package.json and package-lock.json, even if they look correct to you.
The npm ci command is extremely strict and is designed to fail if the two files don’t match perfectly.
Here is the most reliable way to fix this, which forces a clean, synchronized state.
Run these commands in your terminal in order. This will completely remove any “bad state” and rebuild your dependencies from scratch.
Bash
# 1. Force-remove the node_modules folder
rm -rf node_modules
# 2. Delete the package-lock.json file
rm package-lock.json
# 3. Re-install from scratch. This creates a new, 100% correct
# package-lock.json based on your package.json
npm install
After these steps, your package-lock.json will be perfectly in sync with your package.json. Your build process, which uses npm ci, should now pass.
It’s helpful to think of the two commands like this:
npm install: This command is flexible. It reads your package.json and looks at your package-lock.json. If you’ve added a new package to package.json, npm install will go ahead and change your package-lock.json to match.
npm ci: This command is a strict “police officer.” It’s used for builds and servers. It reads your package-lock.json and expects your package.json to be an exact match. If anything is different, it refuses to run and throws an error. This is its job!
The Problem: You likely ended up in a state where the package-lock.json and package.json had a tiny mismatch (even a version or a dependency-of-a-dependency). When you ran npm install, it may have fixed it, but the prototyper’s build environment (which runs npm ci) was still seeing the old, mismatched state.
By deleting node_modules and package-lock.json completely, you force npm install to act like a fresh setup, creating a brand new, perfectly synced package-lock.json.
I have tried all these more than 100 times before giving up and started a new project !! This issue made me lose two days of development !!
Npm build works and compiling was successfull but NPM CI fails when publishing.
Also I am not a techie by profession so that is another issue ![]()
If you want i can share the project with you .