yeoman / update-notifier

Update notifications for your CLI app
BSD 2-Clause "Simplified" License
1.76k stars 132 forks source link

Node v9 support #217

Closed miqmago closed 2 years ago

miqmago commented 2 years ago

I'm working on a project on which this package is installed as a dependency of nodemon (which depends on undefsafe which depends on update-notifier). The project works inside an old docker node:9 image. It's needed to be v9, because otherwise it fails node-gyp

The following code causes an error:

node_modules/update-notifier/index.js:58
            } catch {

Optional catch binding is suported from Node v10 (https://node.green/#ES2019-misc-optional-catch-binding)...

It would be very easy to give support to Node 9 for this package, just needs to change to:

} catch (e) {

That way the module will work fine in node:9 without any impact on functionality or features. I've been thinking that maybe this code is like this because a linting problem, in that case it could also be solved by adding an exception for the line.

sindresorhus commented 2 years ago

No plans to change this. This package clearly defines the required Node.js version. The fact that you cannot use Node.js 10, which is not even supported by the Node.js team anymore, is not really a concern for this package.