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

[BUG] preshrinkwrap, shrinkwrap and postshrinkwrap scripts are not executed #2520

Closed
LeSuisse opened this issue Jan 21, 2021 · 3 comments
Closed
Assignees
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@LeSuisse
Copy link

Current Behavior:

With a package.json looking like that, preshrinkwrap, shrinkwrap and postshrinkwrap scripts are not executed when running npm install:

{
  "name": "mypackage",
  "version": "1.0.0",
  "dependencies": {
    "somedep": "^1.0.0"
  },
  "devDependencies": {},
  "scripts": {
    "preshrinkwrap": "mypreshrinkwrapscript",
    "shrinkwrap": "myshrinkwrapscript",
    "postshrinkwrap": "mypostshrinkwrapscript"
  }
}

Expected Behavior:

preshrinkwrap, shrinkwrap and postshrinkwrap scripts to be executed when running npm install as described in the documentation https://docs.npmjs.com/cli/v7/configuring-npm/package-locks

Note that this behavior works on npm 6.x.

Environment:

Node: 15.6.0
npm: 7.4.0

@LeSuisse LeSuisse added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Jan 21, 2021
@darcyclarke darcyclarke added Priority 2 secondary priority issue and removed Needs Triage needs review for next steps labels Feb 2, 2021
@darcyclarke darcyclarke added Priority 1 high priority issue and removed Priority 2 secondary priority issue labels Jul 19, 2021
@darcyclarke darcyclarke added this to the OSS - Sprint 33 milestone Jul 19, 2021
@darcyclarke darcyclarke removed this from the OSS - Sprint 35 milestone Aug 23, 2021
@wraithgar wraithgar self-assigned this Feb 14, 2022
@wraithgar
Copy link
Member

Those events went away in npm7 because there is no specific shrinkwrap event anymore. The cli command either renames the package-lock, or generates it and saves it with the shrinkwrap name.

@dgreif
Copy link

dgreif commented Feb 15, 2022

@wraithgar Is there any new hook available to detect general changes to package-lock, regardless of how they happen (install, uninstall, update, etc)? We used to use postshrinkwrap to kick off our license check, but have to do this in a custom npm script with npm@8.

@wraithgar
Copy link
Member

No, but we know there is a need for it. It's currently an item in our backlog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

4 participants