# Show a message in the log with \`postinstall\` script

**URL:** <https://discourse.nodered.org/t/show-a-message-in-the-log-with-postinstall-script/82164>\
**Category:** Feature Requests\
**Created:** [18 October 2023 15:23 UTC](https://discourse.nodered.org/t/show-a-message-in-the-log-with-postinstall-script/82164 "2023-10-18T15:23:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [18 October 2023 15:23 UTC](https://discourse.nodered.org/t/show-a-message-in-the-log-with-postinstall-script/82164/1 "2023-10-18T15:23:59Z")

</div>

Hi all,  
I would like to display a message in the log after installation using the `postinstall` script but it seems that this is not natively possible (see [[BUG] npm install does not run postinstall nor does it show name & version of installed pkg · Issue #3647 · npm/cli · GitHub](https://github.com/npm/cli/issues/3647)).

@knolleary would it be possible to add the following flags to the installer (registry)?

- `--foreground-scripts`
- `--loglevel=warn`: to avoid spamming the log (or maybe info level)

Thanks

---

<div class="post-metadata">

**Author:** ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)\
**Post date:** [18 October 2023 18:30 UTC](https://discourse.nodered.org/t/show-a-message-in-the-log-with-postinstall-script/82164/2 "2023-10-18T18:30:09Z")

</div>

> [@GogoVega](#):
>
> - `--loglevel=warn` : to avoid spamming the log (or maybe info level)

Lately I was digging intensively in the details of installer.  
May I ask what kind of "spamming the log" you experienced? I'm not aware of any (generated by npm)...

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [18 October 2023 18:50 UTC](https://discourse.nodered.org/t/show-a-message-in-the-log-with-postinstall-script/82164/3 "2023-10-18T18:50:14Z")

</div>

You're right, after several tests the `loglevel` is not necessary. I don't really have any spam except for audits. (because I forgot to put the flag 🤦‍♂️ ).  
I hadn't checked but by default it's on `notice` which is higher than `info`.  
I had defined the `loglevel` to avoid logs like debug but it will not be useful 😅

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [21 October 2023 09:20 UTC](https://discourse.nodered.org/t/show-a-message-in-the-log-with-postinstall-script/82164/4 "2023-10-21T09:20:49Z")

</div>

What do you think @knolleary about enabling logs during pre/post install scripts?

I don't know if it will be useful to many but I would like to use it to notify the user that they have an action to do. (Knowing very well that not everyone looks at the logs...)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 December 2023 09:21 UTC](https://discourse.nodered.org/t/show-a-message-in-the-log-with-postinstall-script/82164/5 "2023-12-20T09:21:06Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
