Skip to content

npm 12 - blocks lifecycle scripts #1118

Description

@MikeMcC399

Situation

The npm 12.0.0 changelog states:

Dependency lifecycle scripts are now blocked by default unless allowed by the root package's allowScripts policy. After installing, run npm install-scripts approve to record approvals and npm rebuild to 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:

  1. The preinstall.js script of Yarn Classic relates to Corepack. The install-scripts warning should be documented in the README, either with a note that it can be ignored or instructions on how to work around it.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions