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] postinstall scripts not executed during npm install #2467

Closed
AlCalzone opened this issue Jan 9, 2021 · 6 comments
Closed

[BUG] postinstall scripts not executed during npm install #2467

AlCalzone opened this issue Jan 9, 2021 · 6 comments
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@AlCalzone
Copy link

AlCalzone commented Jan 9, 2021

Current Behavior:

postinstall script not executed

Expected Behavior:

postinstall script should be executed.

Steps To Reproduce:

  1. Set up a VM you can trash later (the package modifies your global configuration)
  2. Create directory /opt/iobroker, enter it
  3. run npm i iobroker@latest as root

Environment:

  • OS: Debian Buster
  • Node: 15.5.1
  • npm: 7.3.0
@AlCalzone AlCalzone 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 9, 2021
@ljharb
Copy link
Contributor

ljharb commented Jan 9, 2021

Duplicate of #2194?

@Apollon77
Copy link

@ljharb not really because here it is not about global packages, or? but yes maybe related :-)

@ljharb
Copy link
Contributor

ljharb commented Jan 9, 2021

Are you sure the script isn’t being executed? All output of postinstall scripts is suppressed in npm 7 unless the script fails.

@Apollon77
Copy link

Yes we are sure because many things happen there in the example of the above case and nothing of this is done

@darcyclarke
Copy link
Contributor

Hey @AlCalzone, this does look to be like a duplicate (ie. potentially you are just not seeing output when scripts are run). We just tested this to see if postinstall scripts are working & they seem to be. I've posted a comment back here for some other context (ie. running with the --foreground-scripts flag or changing your loglevel should show output similar to v6): #2194 (comment)

Let us know if you think your scripts still aren't being run as of v7.4.1

@darcyclarke darcyclarke removed the Needs Triage needs review for next steps label Jan 15, 2021
@AlCalzone
Copy link
Author

@darcyclarke It seems like the underlying issue is something different. Our postinstall script does indeed run, but it modifies package.json, so we can install additional dependencies dynamically in the next install step. This used to work in npm6, but now the changes get overwritten later, causing the followup installation steps to be skipped.

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

No branches or pull requests

4 participants