Pnpm legacy peer dependency issue

Locally I am able to install packages, build and run using pnpm.

When deploying to render I am getting errors like this one:

npm ERR! code ERESOLVE

Aug 26 08:07:55 PMnpm ERR! ERESOLVE unable to resolve dependency tree

Aug 26 08:07:55 PMnpm ERR!

Aug 26 08:07:55 PMnpm ERR! While resolving: frontend@0.1.0

Aug 26 08:07:55 PMnpm ERR! Found: react@18.3.1

Aug 26 08:07:55 PMnpm ERR! node_modules/react

Aug 26 08:07:55 PMnpm ERR! react@"^18.2.0" from the root project

Aug 26 08:07:55 PMnpm ERR!

Aug 26 08:07:55 PMnpm ERR! Could not resolve dependency:

Aug 26 08:07:55 PMnpm ERR! peer react@"^16.8.0 || ^17.0.0" from react-toast-notifications@2.5.1

Aug 26 08:07:55 PMnpm ERR! node_modules/react-toast-notifications

Aug 26 08:07:55 PMnpm ERR! react-toast-notifications@"^2.4.0" from the root project

Aug 26 08:07:55 PMnpm ERR!

Aug 26 08:07:55 PMnpm ERR! Fix the upstream dependency conflict, or retry

Aug 26 08:07:55 PMnpm ERR! this command with --force or --legacy-peer-deps

Aug 26 08:07:55 PMnpm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Aug 26 08:07:55 PMnpm ERR!

Aug 26 08:07:55 PMnpm ERR!

Aug 26 08:07:55 PMnpm ERR! For a full report see:

Aug 26 08:07:55 PMnpm ERR! /opt/render/.cache/_logs/2024-08-27T00_07_50_923Z-eresolve-report.txt

Aug 26 08:07:55 PM

Aug 26 08:07:55 PM

from what I can tell, an npm audit is running prior to my build command. Is there anyway to bypass this npm audit so that my build command can run and dependencies can be installed via pnpm?

Hi there,

Is this a Static Site service? If so, you can disable npm from running by setting SKIP_INSTALL_DEPS as an environment variable with the value true: https://docs.render.com/static-sites#dependency-installation.

You could also fix your peer dependency issues. react-toast-notifications specifies these peer dependencies, but you are using react@"^18.2.0 in your packahe.json. react-toast-notifications isn’t maintained anymore so this isn’t going to be updated, but you could use react-hot-toast instead.

Regards,

Keith
Render Support, UTC+10 :australia:

Thanks for your quick response! This is in fact Static Site service. This fix worked for me, thanks again!

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