Install command not working on vercel.json

Hello,

I’m trying to deploy my backend but inorder to install the dependencies I’m using properly I have to “npm install --force” it. I also cant do it on the build and output settings because it says i have a vercel.json file

how could I add the “npm install --force” command in the vercel.json? file this is what I tried doing :

{
“installCommand”: “npm install --force”,
“version”: 2,
“builds”: [
{
“src”: “index.js”,
“use”: “@vercel/node”
},
{
“src”: “src/**/",
“use”: “@vercel/static”
}
],
“routes”: [
{ “src”: "/(.
)”, “dest”: “/” }
]
}

but its still installing it without the --force

Hey,

Does it work if you remove from vercel.json and set directly in your Project Settings?

Also I don’t think you need following anymore:

{
“src”: “index.js”,
“use”: “@vercel/node”
},
{
“src”: “src/**/",
“use”: “@vercel/static”
}

Vercel build tool automatically takes care of those.

1 Like

I tried removing the vercel.json and do the “npm install --force” on the project settings, it runs “npm install --force” correctly and now proceeds to run the build however after running the build it installs the dependencies again but now without the “–force” just a normal npm install then it errors

Do you have a deployment url that we can look?

1 Like

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