-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Consider removing/replacing update-notifier #1961
Consider removing/replacing update-notifier #1961
Comments
I don't disagree, but you're point (2) doesn't address what update notifier solves: automatic notification of upgrade. All other solutions require the user to specifically ask whether there's an upgrade (potentially one that does fix a vuln). I strongly believe that this project needs something like upgrade notifier, though I'm not convinced it requires that particular dep or any of it's complexity... |
Just my 2c, but I agree with OP. Currently Yes, it adds the ability to automatically notify, but we have other specialized tools nowadays for that that run in CI. What we don't have right now is the ability to update that ansi dep that has a security issue. Removing so many dependencies from Nodemon would increase security considerably. Let me know what you think and if you need help. |
I've already agreed that I'd rather not have the dependency. What I'd need to do to remove the dep is to have a bespoke, nodemon specific system to notify of updates. In my head that would probably check an npm endpoint for the current version and compare to the local version, along with a backoff (i.e. do it once a week, or even opt-out), then show a notice. |
👍 on removing it it is a waste of install time of having to download and exec all of this every time some CI needs to build. |
@jimmywarting it's a waste of time including nodemon as part of your CI dependencies… seems like something you wouldn't want to do. |
nodemon is in there with eslint and everything else in dev devdependencies, everytime a PR comes in it must download all dev dependencies as well... i think a dependabot or something is a better solution. v1.x is deprecated and don't get any more security patches, update to v2 that way we will get the notification too. |
I would rather have something as small and dependency free version like this running each and every time than having to load 84 modules and risk getting any security issues const fs = require('node:fs/promise')
const https = require('node:https')
https.get('https://registry.npmjs.org/nodemon', async response => {
let body = ''
for await (const chunk of response) body += chunk
const json = JSON.parse(body)
const latest = json['dist-tags']['latest'].split('-')[0]
const pkg = await fs.readFile(`${__dirname}/../../package.json`, 'utf8')
const pkgJson = JSON.parse(pkg)
if (latest.localeCompare(pkgJson.version, 'en', {numeric: true}) === -1) {
console.info(`New version of nodemon is available update to ${latest}`)
}
})
// haven't tested this code but should work but preferable nothing at all - just run every sub dependency that you have no control over is a potentially security risk |
Pop it in a PR (and probably test!), but yeah, I already agreed: #1961 (comment) |
Another vulnerability introduced by update-notifier and unlikely to be resolved on its own: #2023 |
It's worth mentioning that upgrading to a newer version of Specifically, |
For those worried about CI and other environments where you need dev dependencies but not things like nodemon, this is what I use
Then in your CI/CD/Docker/Whatever:
|
Closes #1961 Closes #2028 - Fixes security issue with got (CVE-2022-33987) - Replace update-notifier with simple-update-notifier which does the same thing but has one dependency (semver) rather than several - Same caching settings as update-notifier Congratulations and thanks to @alexbrazier 👏 🥇 ❤️
🎉 This issue has been resolved in version 2.0.19 🎉 The release is available on: Your semantic-release bot 📦🚀 |
thank you @remy!!! |
This is the dependency tree I got from installing
nodemon
in an empty project:update-notifier
pulls in more dependencies than the rest ofnodemon
.I personally think that the drawbacks from keeping outweigh the benefits:
nodemon
dependency tree.nodemon
dependencies have come from theupdate-notifier
tree. Not all of the vulnerabilities affectnodemon
, but again, it's not easy to immediately tell.npm outdated
reports that about 70 requirements are at least 1 major version behind. I'm sure that some of the updates are not currently necessary, but perhaps they may soon.update-notifier
was added, the ecosystem has improved visibility and handling of dependency updates. We havenpm outdated
andyarn upgrade-interactive
, andnpx nodemon
without an explicit dependency will try to run the latest version by default.Thoughts?
The text was updated successfully, but these errors were encountered: