Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make npm install scripts opt-in #488

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Commits on Nov 5, 2021

  1. Install scripts that can run just about anything by default pose some…

    … pretty serious security considerations, and these are inreasingly moving out of the theoretical realm and becoming actively exploited. See for example here: https://therecord.media/malware-found-in-coa-and-rc-two-npm-packages-with-23m-weekly-downloads/.
    
    At the same time, we have developed better techniques for many of the most common use cases for install scripts in the many years since npm originally included then. In particular, [N-API](https://nodejs.org/api/n-api.html) offers a compelling alternative to binary packages that are built on the users' computer. However, even before this, many packages are choosing to just pre-build for multiple platforms ahead of time to handle most of the common installation targets and make the install process easier on the user in general.
    
    Instead of by default always running the install scripts (`preinstall`, `install`, `postinstall`, `prepublish`, `preprepare`, `prepare`, `postprepare`) if they are present during the install process, provide flags to require users to explicitly allow them to run, either whoelsale as "one big swtich", or on a package by package (and optionally version by version) basis. Also provide matching `npm config` options to do the same globally and permanently instead of on every install.
    
    Reviewed by @tolmasky.
    tolmasky committed Nov 5, 2021
    Configuration menu
    Copy the full SHA
    15ec3f8 View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2021

  1. Add some statistics and scenarios.

    Reviewed by @tolmasky.
    tolmasky committed Nov 17, 2021
    Configuration menu
    Copy the full SHA
    cedb22f View commit details
    Browse the repository at this point in the history
  2. Fix table.

    Reviewed by @tolmasky.
    tolmasky committed Nov 17, 2021
    Configuration menu
    Copy the full SHA
    d3417c7 View commit details
    Browse the repository at this point in the history
  3. Use legacy.

    Reviewed by @tolmasky.
    tolmasky committed Nov 17, 2021
    Configuration menu
    Copy the full SHA
    4c5e3db View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    89313c0 View commit details
    Browse the repository at this point in the history
  5. More number corrections.

    Reviewed by @tolmasky.
    tolmasky committed Nov 17, 2021
    Configuration menu
    Copy the full SHA
    6a0151c View commit details
    Browse the repository at this point in the history