Deployment Failing – npm error Invalid Version

Issue Summary:
My application is failing to deploy on Vercel with the following error during the install step:

npm error Invalid Version:

Build Logs:

[09:56:24.942] Running build in Washington, D.C., USA (East) – iad1  
[09:56:24.943] Build machine configuration: 2 cores, 8 GB  
[09:56:24.956] Cloning github.com/manishdashsharma/auth-flow (Branch: main, Commit: 6a7185e)  
[09:56:25.093] Previous build caches not available  
[09:56:25.210] Cloning completed: 254.000ms  
[09:56:26.986] Running "vercel build"  
[09:56:27.440] Vercel CLI 44.6.4  
[09:56:27.738] Installing dependencies...  
[09:56:28.804] npm error Invalid Version:  
[09:56:28.806] npm error A complete log of this run can be found in: /vercel/.npm/_logs/2025-08-01T04_26_28_009Z-debug-0.log  
[09:56:28.837] Error: Command "npm install" exited with 1  

Expected Behavior:
I expect the app to install dependencies and build successfully, then deploy as usual.


Steps to Reproduce:

  1. Connect GitHub repo: auth-flow
  2. Deploy to Vercel (auto build using default settings)
  3. Observe failure during npm install

What I’ve Tried:

  • Double-checked package.json for version errors
  • Cleared and reinstalled local dependencies
  • Deployment from a fresh branch — still fails
  • No specific version is defined with an invalid string (e.g., empty or malformed version in package.json)

Repository:
https://github.com/manishdashsharma/auth-flow


Any help to resolve this would be appreciated. Please let me know if additional logs or access are needed.

Can you delete package-lock.json > Regenerate using npm i and then push to see if it resolved?

I tried deleting package-lock.json, re-running npm install, and pushing again (also made a small change to .gitignore to trigger redeployment), but unfortunately the deployment is still failing with the same error:

npm error Invalid Version:

Thanks!

[13:45:05.383] Running build in Washington, D.C., USA (East) – iad1
[13:45:05.384] Build machine configuration: 2 cores, 8 GB
[13:45:05.442] Cloning github.com/manishdashsharma/auth-flow (Branch: main, Commit: 5bc9da1)
[13:45:05.567] Previous build caches not available
[13:45:05.725] Cloning completed: 282.000ms
[13:45:06.023] Running "vercel build"
[13:45:07.030] Vercel CLI 44.6.4
[13:45:08.048] Installing dependencies...
[13:45:09.224] npm error Invalid Version: 
[13:45:09.225] npm error A complete log of this run can be found in: /vercel/.npm/_logs/2025-08-01T08_15_08_411Z-debug-0.log
[13:45:09.261] Error: Command "npm install" exited with 1
[13:45:09.706] ```

I don’t see the new package-lock.json unfortunately: History for package-lock.json - manishdashsharma/auth-flow · GitHub. It’s still 3 hours old

Did you generate package-lock using npm i? It should have more changes than just a version number:

Btw, your project is also failing to build on local:


This what i did

The build is now ok

Still the same issue

That is due to to package-lock.json. SInce you aren’t generating package-lock.json properly. Could you remove it entirely from your repo and try ?

Let me try but , i didn’t i am not generating the package-lock.json properly? npm i is the command right ?

Yes it is the command but as you can see your commit didn’t have any change related to package-lock.json Build issue · manishdashsharma/auth-flow@c6be162 · GitHub

Removing the package-lock.json worked , Thank you but i still have the same question why it is happening , the package lock is not changing

check if you have package-lock.json excluded using .gitignore or something. If you deploy using Vercel CLI, it should work as well.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.