Avoid automatic installation of dependencies on static website

We use pnpm but the static website first installs dependencies with npm. Explicitly specifying the packageManager in the package.json does not have an effect.

You can see from the log here that npm kicks off first and then it runs the build command:

...
Jun 26 07:34:48 PM  ==> Using Node version 19.8.1 via /opt/render/project/src/.node-version
Jun 26 07:34:48 PM  ==> Docs on specifying a Node version: https://render.com/docs/node-version
Jun 26 07:34:49 PM  ==> Using Ruby version 2.6.8 (default)
Jun 26 07:34:49 PM  ==> Docs on specifying a Ruby version: https://render.com/docs/ruby-version
Jun 26 07:35:20 PM  ==> Installing dependencies with npm...
Jun 26 07:36:03 PM  
...
Jun 26 07:36:06 PM  
Jun 26 07:36:06 PM  Some issues need review, and may require choosing
Jun 26 07:36:06 PM  a different dependency.
Jun 26 07:36:06 PM  
Jun 26 07:36:06 PM  Run `npm audit` for details.
Jun 26 07:36:16 PM  ==> Using Python version 3.7.10 (default)
Jun 26 07:36:16 PM  ==> Docs on specifying a Python version: https://render.com/docs/python-version
Jun 26 07:36:20 PM  ==> Running build command 'pnpm install --filter landing; pnpm build-ssg;'...

Is there a way to avoid the npm install?

Hi there,

You can use the SKIP_INSTALL_DEPS environment variable. See https://render.com/docs/static-sites#dependency-installation for more information on that.

Regards,

Matt

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