-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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] No "postinstall" on global packages anymore #2194
Comments
Are you sure it’s not running it, as opposed to not displaying any output? |
Apparently it is running, but I need to show staff to the user, as it worked before v7 |
That was intentionally suppressed in v7, to prevent spamming users with ads and similar messages. You’ll have to wait to show the users the output until the first time they use your tool. |
Could you please share a link to an official announcement of this change? I will need to explain this to my client |
https://blog.npmjs.org/post/626173315965468672/npm-v7-series-beta-release-and-semver-major is the announcement, but it may not mention this one specifically. |
Ah, I didn’t realize it wasn’t actually running them globally. |
So how am I supposed to run a script that needs user input when installing my script? |
Generally speaking, installs aren't a place where user input is available - consider installs in CI. |
good point, hadn't seen it that way |
We also have the same issue on non-global but "npm i in a directly by using the local package.json" ... it seems that postinstall and install is not executed |
The issue can be replicated also with Decktape with
|
The originating issue is actually the intended experience in v7; If you want to see when scripts are run, you can add the flag |
Current Behavior:
I'm making a global cli tool that asks you for your language preference upon install but since NPM 7 it doesn't run the postinstall script anymore
Expected Behavior:
In NPM 6 it works just fine
Steps To Reproduce:
npm i -g dnd
Environment:
macOS Big Sur, npm 7
The text was updated successfully, but these errors were encountered: