I appreciate the sentiment (and it's what I do with my own hilariously unsuccessful software), but you can't walk into a room full of data-driven aspiring entrepreneurs and tell them to do exactly what the market has shown it doesn't want, even though that would be better for all of us.
More to the point: by injecting advertising directly into packages distributed through a package repository and/or a specific toolset / toolchain / language, the parties injecting the advertising are exploiting and mining the accrued trust of that project, toolchain, and/or language, for personal gain.
It's a tragedy-of-the-commons effect: socialised costs (building of the larger toolchain), privatised benefits (ads revenue).
The long-term consequence will be a very-well-deserved shunning of the toolchain by others. A cost largely born by the vast majority not acting antisocially.
Data-driven aspiring entrepreneurs would notice that companies attempting to create and sell distributed free software haven't historically done so well. Putting ads in free software doesn't make it analogous to the business of Google and Facebook.
If you are a software developer and you want software without adverts, pay for it. If you want software for free, you accept whatever the author of that software chooses to do to pay their bills.
And I think the collective opinion here is that we'd rather go without that software than to pay for it that way. In other words, we won't accept those terms and we won't use that software.
We are talking about Free Software, libraries, and advertisements in the console. I think the collective opinion is that developers would rather not use that package than be subjected to ads in their console.
2. Gratis.
3. Gratis; donations welcome.
#3 is barely adware. Sometimes people are extra appreciative of someone's work and want to express that through action; this just tells them how.
On a personal level, I have no issue with an OSS author asking for donations. I draw the line at a company doing so. (An individual soliciting donations for something unrelated, like vim's "Help poor children in Uganda!" insert, isn't my favorite.)
Giving away software for free and then using adware to make up the difference is something else entirely.
If someone wants to make money with developing software, they have many many ways of doing that. Framing this as poor starving software developers getting the shaft by for-profit companies is a huge mis-representation of the situation. No one is chained to their desk and forced to produce NPM packages.