-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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] npm install does not run postinstall nor does it show name & version of installed pkg #3647
Comments
Are you sure it's not executing it but suppressing output? In npm 7, dependencies can't spam the console with postinstall messages. |
It does execute. Run with |
hm. so what options are remaining to show an intro message after somebody executes |
The user could opt in to it, but there are no intro message options. Tell them what you need to tell them in your docs. |
hm. No, that's not correct. there isn't really an option to "opt-in" for the user because the above commands both show way more info than what the actually installed plugin is executing in the postinstall. in our case, we urge users to reload their IDE which is constantly forgotten despite being in the docs.
And even without both parameters, the current output doesn't even acknowledge what version one just installed. While 6.x basically did what --foreground-scripts is doing, it also printed the version of the installed package which --foreground-scripts in 7.x does not, nor does the standard output for that matter. --> while you obviously intended good I don't believe that's what you accomplished here and urge to rethink it. |
What is your use case for an intro message? As a user, I would never, ever want that. |
" in our case, we urge users to reload their IDE which is constantly forgotten despite being in the docs." |
If they won't read the docs then why would they read the install message? |
:| #motivation people are waiting for the install to finalize and right now it doesn't even output a "hey, what you just tried installing is now installed" anymore - contrary to 6.x and whatever message I output as part of postinstall can (& does) use colors, making sure people can see it easily. |
im requesting to re-open this issue |
Please re-open this issue. Running npm 8.1.0 and pre/post npm scripts are no longer able to echo to the terminal. This is a huge regression. |
@atomless this happened in v7.0.0 and was very intentional, and I don't believe there's any plans to change it. |
I have the same problem. In my case, the postinstall script will be executed a few minutes. So I'd like to print some messages for user to tell them the dependency is executing something expected rather than still frame. If not it will makes them feel meeting unknown error. |
It is also not executing then. i have run all types of higher log levels and there is nothing to indicate that it is being run, nor is there any creation of the items which neccesitate the use of the postinstall. |
Is there an existing issue for this?
Current Behavior
when running
npm install ...
with a local package or a package on npm's servers it does not execute whatever is in scripts.postinstallfor
![image](https://user-images.githubusercontent.com/1917227/129355963-355f115e-c82b-4bca-874d-1b0057874e89.png)
Expected Behavior
in the 6.x releases it would state the line found in postinstall while executing it, means for the above example one should see
It also printed the name & version of the package it just installed.
While the above example is trivial, it also extends to linking / running a *.js file with more complex logic via postinstall.
In #1905 a similar issue was mentioned for
npm ci
but somehow it still worked fornpm install
back then.Steps To Reproduce
Environment
The text was updated successfully, but these errors were encountered: