Recommended approach to install PNPM 10 #9044
-
|
In PNPM <10, we installed and enabled PNPM via Corepack, and Corepack would manage the version via the After nodejs/corepack#612 we are looking to stop using Corepack and would ideally like a consistent way to install PNPM for production builds and also for all engineers in local environments. PNPM has many installation methods with Corepack being listed second after a standalone install. PNPM 10 adds a new configuration option:
Which replaces Corepack's functionality post-install. But pre-install, activiating PNPM via Corepack to then not use Corepack to manage the PNPM version feels counterintuitive. In Node.js projects, what's the recommended approach to setting up and using PNPM? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
|
I still think that corepack is probably the best option. You can safely use corepack, just disable the integrity check. Or update corepack to the latest version. Alternatively, you could install pnpm with npm if that works in your scenario. If you use Github actions, you may also use our github action to get pnpm installed. |
Beta Was this translation helpful? Give feedback.
-
|
I'm in the same boat. Hearing corepack becoming deprecated for a project that needs to just run for a long time, makes me wonder what the best way to handle it is. I kinda dislike having to install it twice too when you separate build from the container. It would be better if the PNPM team would supply its own docker image where pnpm is already installed, to just skip the whole installation phase |
Beta Was this translation helpful? Give feedback.
-
|
Here's my recommended approach for installing pnpm 10 across different environments, considering the Corepack changes: 📦 Recommended Installation Strategy1. CI/CD (GitHub Actions) - Use the Official Action- uses: pnpm/action-setup@v4
with:
version: 10This is the most reliable approach for CI and handles caching automatically. 2. Local Development / Production - Standalone ScriptSince Corepack is being removed from Node.js 25+, I recommend the standalone installation: macOS/Linux: curl -fsSL https://get.pnpm.io/install.sh | sh -Windows (PowerShell): iwr https://get.pnpm.io/install.ps1 -useb | iex3. Fallback Option - npm global installnpm install -g pnpm@10🔄 Version Management with pnpm 10pnpm 10 has
This eliminates the need for Corepack's version management entirely! Summary
Hope this helps! 🚀 |
Beta Was this translation helpful? Give feedback.
-
|
Can the maintainers clarify in the docs which is the ideal method to setup |
Beta Was this translation helpful? Give feedback.
I still think that corepack is probably the best option. You can safely use corepack, just disable the integrity check. Or update corepack to the latest version.
Alternatively, you could install pnpm with npm if that works in your scenario.
If you use Github actions, you may also use our github action to get pnpm installed.