You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting from PNPM v10, PNPM requires maintaining an onlyBuiltDependencies list in package.json for allow-listing dependencies that can have their post-install scripts executed (see https://github.com/pnpm/pnpm/releases/tag/v10.0.0).
We can use it, and it's okay, but when the NX Webpack plugin generates a minimal package.json for a specific app, it doesn't copy these definitions over to the generated files, potentially causing runtime issues for applications built using the generated file.
Checkout the repo and run pnpm nx build demo on the main branch. This branch uses PNPM v9. Note that the generated package.json under dist/apps/demo is generated as expected.
estiller
changed the title
Incompatibility with PNPM v10
PNPM v10's onlyBuiltDependencies not supported in package.json generation
Mar 3, 2025
estiller
changed the title
PNPM v10's onlyBuiltDependencies not supported in package.json generation
PNPM v10 not supported in NX Webpack Pluginpackage.json generation
Mar 3, 2025
Current Behavior
Starting from PNPM v10, PNPM requires maintaining an
onlyBuiltDependencies
list inpackage.json
for allow-listing dependencies that can have their post-install scripts executed (see https://github.com/pnpm/pnpm/releases/tag/v10.0.0).We can use it, and it's okay, but when the NX Webpack plugin generates a minimal
package.json
for a specific app, it doesn't copy these definitions over to the generated files, potentially causing runtime issues for applications built using the generated file.The
package.json
file is generated using this code: https://github.com/nrwl/nx/blob/master/packages/nx/src/plugins/js/package-json/create-package-json.tsExpected Behavior
The NX Webpack plugin should copy over the
onlyBuiltDependencies
for the generatedpackage.json
files using PNPM.GitHub Repo
https://github.com/estiller/nx-pnpm-v10-issue
Steps to Reproduce
pnpm nx build demo
on themain
branch. This branch uses PNPM v9. Note that the generatedpackage.json
underdist/apps/demo
is generated as expected.pnpm-10
branch (this is the relevant commit).pnpm install
and allowcorepack
to install the latest version ofpnpm
if it is not already available.pnpm nx build demo --skip-nx-cache
.package.json
underdist/apps/demo
now uses PNPM v10, but theonlyBuiltDependencies
field is not copied over.pnpm install
under thedist/apps/demo
folder results in a warning, and post-install scripts are not executed.Nx Report
Failure Logs
When running
pnpm install
using the generatedpackage.json
underdist/apps/demo
you get:Package Manager Version
pnpm 10.5.2
Operating System
Additional Information
See also the discussion on the PNPM repo - https://github.com/orgs/pnpm/discussions/9205
The text was updated successfully, but these errors were encountered: