Nodemon: Remove promotional banner on postinstall

Created on 22 Dec 2017  Â·  17Comments  Â·  Source: remy/nodemon

I'm using nodemon since a long time. Suddenly it started to show this banner on every install:

> [email protected] postinstall /home/guu/workspace/programming/code/IGZ/AZLO/services/openplatform-sandbox-service/node_modules/nodemon
> node -e "console.log('\u001b[32mLove nodemon? You can now support the project via the open collective:\u001b[22m\u001b[39m\n > \u001b[96m\u001b[1mhttps://opencollective.com/nodemon/donate\u001b[0m\n')"

Love nodemon? You can now support the project via the open collective:
 > https://opencollective.com/nodemon/donate

I think that's not the purpose of the postinstall script. But aside from that, I have dozens of services and countless pipelines where this is being shown too many times.

I consider this to be unnecessary SPAM.

Is it possible to remove that promotion and just leave it in the README page instead? Thanks

Most helpful comment

Thanks for your feedback. You use nodemon on dozens of projects you say? I assume you're supporting the project somehow? If not, I guess my method to promote the problem is working. Cheers.

All 17 comments

Thanks for your feedback. You use nodemon on dozens of projects you say? I assume you're supporting the project somehow? If not, I guess my method to promote the problem is working. Cheers.

@remy Hijacking this issue: using node just to print to the console is overkill, and I'm running into an issue installing this package with Docker + nvm where it can't find the node executable during postinstall (for whatever reason). Could you just simplify this to an echo call?

@spencerhakim I know what you mean, but node in one process that I can be sure that would be installed (but you're right, it might not be in the path). I'm not entirely sure what would happen if I ran echo on Windows…

Related, I do want to suppress the message if nodemon is in CI (though I'm not entirely convinced nodemon should even be installed under CI!)

@remy I'd generally agree with your sentiment regarding nodemon in CI, but my build process requires other devDeps so I don't have much of a choice in that regard. Regardless, I need to fix my PATH issue since even if remove nodemon, my project's npm start fails to find node. Love returning from the holidays to find that something like this no longer works...

@IGZgustavomarin if it's too much to take, npm i > /dev/null 🙈

This promotional message broke ansible task because it's treated as a failure.

@attrox what version of nodemon were you testing with? The postinstall in the latest code is designed to fail gracefully: https://github.com/remy/nodemon/commit/64a82ff81a2a0c0b562d298698aa52a3628da77f?diff=split

@remy it's 1.14.10
It does have the " || exit 0" bit, but Ansible still fails at that point.

@attrox Do you want to create a new issue - and possibly help with any ideas on how to get Ansible to accept the exit 0? I'd also suggest including the output you're seeing so more eyes (hopefully!) can get ideas.

I finally found the Ansible fix for this
- name: Install Npm packages
command: npm install
register: result
failed_when: "result.stderr is defined and 'ERR!' in result.stderr"

Can I make the message disappear by donating?

@Janpot you can but only try. And just think, if there's enough momentum around the open collective route, then it'll probably drive itself and not need the banner.

🙂 I'm just playing the devil's advocate. I prefer to contribute in a different way. I wish you success on your journey though.

Imagine a situation when you need to install one package with a lot of dependencies and the screen fills with such "asking for donations" messages.

The time will come, and we would have adblockers for terminals, but for now you can run this:

> npm remove -g nodemon
> npm install -g forever
> cd /path/to/your/project
> forever start --watch .
> forever logs -f .

There are many alternatives, which you can use freely, just remember that.

Not that I'm against your project, or I don't want to donate... actually I will not donate anything, just because you explicitly ask for it after each install.

@remy I said dozens of services, a single project with lots of different services that use nodemon during development. Each commit that is merged to master triggers a build > test > deploy. During test phase, nodemon is installed (even its only used for dev, not tests) and I get the banner on every commit, every pipeline. I see this message hundred of times a day, for one project with a microservice architecture. That's is why I'm complaining about it.

actually I will not donate anything, just because you explicitly ask for it after each install

Not supporting the project because it asks for support. Classy. I'm glad you've (all) got alternative tools to use, at least you're not stuck.

It's a bit of a shame that the only suggestions on this thread have been to remove the request for support, to complain or to just be a bit snarky. It's a shame no one has come up with a solution like…I don't know, maybe a PR that's smart that detects that the message has been shown in the last 24 hours and doesn't show it again for that day using a (root) config flag?

A real shame.

For those using nodemon in a CI-type environment, no one actually came up a with a solution or a PR to help this process, but I've just submitted this PR which should help your situation.

See FAQ for more: https://github.com/remy/nodemon/pull/1334/files#diff-4a1318da06786ac52626178ca960109eR43

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Autre31415 picture Autre31415  Â·  4Comments

fabianMendez picture fabianMendez  Â·  4Comments

olalonde picture olalonde  Â·  3Comments

medoix picture medoix  Â·  4Comments

endquote picture endquote  Â·  4Comments