npm 12 - blocks lifecycle scripts
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 606
- Forks
- 157
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 3
Description
Situation
The npm 12.0.0 changelog states:
Dependency lifecycle scripts are now blocked by default unless allowed by the root package's
allowScriptspolicy. After installing, runnpm install-scripts approveto record approvals andnpm rebuildto execute newly approved scripts.
This also affects global installs.
Using npm install -g citgm, as specified in the README > Installation section, blocks the installation of yarn@1.22.22 preinstall.js.
Steps to reproduce
Ubuntu 24.04.4 LTS, Node.js 24.19.0, initially with npm 11.17.0
npm install -g npm@12.0.2
npm install -g citgm@10.0.2
Logs
$ npm install -g citgm@10.0.2
npm warn deprecated uid-number@0.0.6: This package is no longer supported.
npm warn deprecated normalize-git-url@3.0.2: This package is no longer supported.
added 152 packages in 23s
42 packages are looking for funding
run `npm fund` for details
npm warn install-scripts 1 package had install scripts blocked because they are not covered by allowScripts:
npm warn install-scripts yarn@1.22.22 (preinstall: :; (node ./preinstall.js > /dev/null 2>&1 || true))
npm warn install-scripts
npm warn install-scripts Run `npm install -g --allow-scripts=yarn` to allow these scripts once, or `npm config set allow-scripts=yarn --location=user` to allow them for all global installs.
Suggestion
Review the impact of this issue:
- The preinstall.js script of Yarn Classic relates to Corepack. The
install-scriptswarning should be documented in the README, either with a note that it can be ignored or instructions on how to work around it. - Consider dropping yarn@1 which is unsupported. Yarn v1 Classic package manager has been frozen since the release of Yarn 2 in January 2020 and is unsupported since then. It does not meet the general criteria for inclusion into citgm, which require supportability of components used / tested.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the README's Installation section and the citgm dependency setup referenced by the npm install -g citgm@10.0.2 reproduction. Review how Yarn Classic is included and how npm 12 blocks its preinstall.js script. Done means documenting the warning and workaround, or removing the unsupported yarn@1 dependency if that is the chosen resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- documentation, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100