Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pnpm and Next.js in multi-stage docker file?

The official Next.js Dockerfile example does not work if I switch npm to pnpm.

How should I modify that Dockerfile so that it remains multi-stage, but also uses pnpm instead of npm?

like image 389
Meglio Avatar asked Dec 05 '25 15:12

Meglio


1 Answers

Another solution is installing pnpm using npm. When you install nodejs it comes with npm as the default package manager. So you can install pnpm using npm using the following command npm install -g pnpm

In the docker file it will be written as;

RUN npm install -g pnpm
like image 69
James Kaguru Kihuha Avatar answered Dec 08 '25 04:12

James Kaguru Kihuha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!