-
pnpm 10 now ignores lifecycle scripts by default. I am looking for a command to retrieve packages that have this ignored lifecyle script. MotivationI want to detect packages whose lifecycle scripts are being ignored. Current behaviorIf already have # first time - show warning
$ pnpm install
Lockfile is up to date, resolution step is skipped
Packages: +40
++++++++++++++++++++++++++++++++++++++++
Progress: resolved 40, reused 40, downloaded 0, added 40, done
dependencies: +40, reused 40, downloaded 0, added 40, done
+ canvas 3.0.1
The following dependencies have build scripts that were ignored: canvas
To allow the execution of build scripts for these packages, add their names to “pnpm.onlyBuiltDependencies” in your “package.json”, then run “pnpm rebuild”.
Done in 1.6s
# second time - no warning
$ pnpm install
Already up to date
Done in 456ms
Done in 456ms The following features may solve this problem.
workaround: The only way I have found to determine this is to remove rm -rf node_modules && pnpm install | (grep -q “The following dependencies have build scripts that were ignored” && exit 1 || exit 0) If you have a more stable way to do this, I would appreciate it. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
We don't have such command yet. We currently store the list of ignored dependencies inside the "ignoredBuilds" field in "node_modules/.modules.yaml". We can add a flag to make pnpm exit with a non-0 exit code if there are ignored builds not explicitly listed in some ignore list. |
Beta Was this translation helpful? Give feedback.
-
Sorry if this is only tangentially related, but I just wanted to share some observations which are difficult to package in a way that warrant their own discussion topic. At some point, I collected this from my terminal output. Probably during a (re-)installation of dependencies. Notably I've been unable to reproduce the output despite removing my
Maybe it's better asked directly to the package maintainer, but given this package.json, I don't see any "lifecycle scripts"? I'm fuzzy on the exact definition of a "lifecycle script" though, so perhaps I'm just missing something? Then, in the
All in all, it seems that the |
Beta Was this translation helpful? Give feedback.
We don't have such command yet. We currently store the list of ignored dependencies inside the "ignoredBuilds" field in "node_modules/.modules.yaml".
We can add a flag to make pnpm exit with a non-0 exit code if there are ignored builds not explicitly listed in some ignore list.