4 ms·
That would be very easily solved by adding a Node.js version or range in your package.json that specifies where the program is supposed to run, and treat major
by franciscop 4y ago
That would be very easily solved by adding a Node.js version or range in your package.json that specifies where the program is supposed to run, and treat major versions as breaking. There's a balance to be had here, and avoiding breaking anything at all costs is surely not really balanced and it's starting to add a lot of cruft that will be needed to be maintained long-term.
The solution is not to "warn loudly" here; specify a Node.js version in your package.json, and your code will continue working on that version. Upgrade the Node.js engine version, and then it's on the person upgrading making sure that nothing breaks. That's how virtually all platforms work (except the web itself, but that's not "versioned" so it's fair).
It's a bit more troublesome when changing core packages and considering dependencies, but the same could apply there.