How to disable automatic npm install for a static site?

I have a rails monorepo with a subdirectory which contains a static site which I want to be a static site on render. However, when I deploy this, it automatically runs npm install from the root of the repository, despite that not being a command in my build script. This fails for reasons specific to me, though even if it succeeded this wouldn’t be desired, as it would install a number of unnecessary dependencies.

Is it possible to disable this automatic npm install – or even better, change the directory in which it runs? Ideally this would be configurable via an environment variable, as I’m using this same repo for other services.

Hi @kai,

You can set an env variable SKIP_INSTALL_DEPS true to skip automatically installing the dependencies. This is something that we automatically detect and do. If you set this, you can include steps in your build script to cd into the right directory and run your npm install there.

1 Like

Thanks, this is perfect!

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