Skip to content

Update: NPM Security Cheat Sheet #3027

Open

Description

@cryptostrapon

What is missing or needs to be updated?

The cheat sheet recommends adding ignore-scripts=true to .npmrc. In an npm workspaces monorepo, this only works in the .npmrc at the workspace root. npm does not read a .npmrc inside a workspace folder (npm/cli#4605, closed as intended):

  • A root npm install ignores that file without any warning and still runs lifecycle scripts.
  • Commands run from inside the workspace folder only log ignoring workspace config at <path>/.npmrc (source).

I reproduced this on npm 10.9.9 and 12.2.3. A team that follows the current advice per package in a monorepo gets no protection and no warning.

How should this be resolved?

Add one bullet right after the ignore-scripts=true recommendation: in an npm workspaces monorepo, put the setting in the .npmrc at the repository root, with links to npm/cli#4605 and the npm source above. No other changes.

If this is approved, I will open a pull request for this single file that references this issue.

AI disclosure: an AI tool (Claude) helped draft this text. The npm behavior was reproduced and checked manually.

Activity

  1. added
    ACK_WAITING
    UPDATE_CS
    HELP_WANTED
    on Nov 22, 2026
  2. added
    ACK_OBTAINED
    and removed
    ACK_WAITING
    HELP_WANTED
    on Nov 23, 2026
  3. mackowski commented on Nov 23, 2026

    @mackowski
    Collaborator

    Thanks @cryptostrapon, this is a useful clarification. The existing advice to set ignore-scripts in a project .npmrc does not hold for workspace folders in an npm monorepo, so a short note next to that recommendation makes sense. Please go ahead with a pull request that changes only this file and references this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ACK_OBTAINEDUPDATE_CS

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions