Next.js pnpm Support
If you’re planning to use pnpm with Next.js to manage dependencies, you must do one of the following:
-
Set a
PNPM_FLAGS
environment variable with a value of--shamefully-hoist
. This appends a--shamefully-hoist
argument to thepnpm install
command that Netlify runs. -
Enable public hoisting by adding an
.npmrc
file in the root of your project with this content:public-hoist-pattern[]=*
Learn more about using pnpm on Netlify.
Did you find this doc useful?
Your feedback helps us improve our docs.