insect icon indicating copy to clipboard operation
insect copied to clipboard

Specify Node.js version requirement

Open triallax opened this issue 2 years ago • 12 comments

Having a lower bound for the required Node version is probably a good idea. The question is, what is the lowest version we want to support? We can opt to supported the oldest LTS version that has not reached EOL (currently the Node.js 14 line). We can also go back a bit earlier and support Node.js 12 for now, which reached EOL this April.

Opinions?

triallax avatar Jun 03 '22 10:06 triallax

Good idea!

We can opt to supported the oldest LTS version that has not reached EOL (currently the Node.js 14 line).

That sounds good. I'm also okay with setting it to an even higher node version, if there are any clear benefits in doing so.

sharkdp avatar Jun 04 '22 11:06 sharkdp

Hm. I noticed today that Ubuntu 20.04 only comes with Node 10. Even Ubuntu 22.04 (LTS) only comes with Node 12. It would be great if we could still support those distributions. Or does that hold back development significantly?

I think we currently do not support Node 10 (can't remember the precise error, but some problem with a dependency).

sharkdp avatar Jul 06 '22 19:07 sharkdp

Or does that hold back development significantly?

I personally have no problem with supporting earlier Node versions, but dealing with dependencies that do support only later versions may be a pain, just as you mentioned.

triallax avatar Jul 06 '22 21:07 triallax

Unfortunately, the current master version does not work on Ubuntu 20.04 (Node v10.19.0) anymore:

import * as Insect from "./insect.js";
       ^

SyntaxError: Unexpected token *
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

sharkdp avatar Jul 27 '22 21:07 sharkdp

I'm aware of that error, but even if we fixed it, we still have to stop depending on clipboardy (and possibly other dependencies), which does not support Node 10. We could also go back to an older version, but I don't know how much of a pain that might be.

triallax avatar Jul 27 '22 21:07 triallax

I'm aware of that error, but even if we fixed it, we still have to stop depending on clipboardy (and possibly other dependencies), which does not support Node 10.

It looks like 2.3.0 should still support Node.js 8: https://github.com/sindresorhus/clipboardy/releases

There are no significant bug fixes / features in 3.0 as far as I can tell.

We could also go back to an older version, but I don't know how much of a pain that might be.

I would appreciate if we could try.

sharkdp avatar Aug 02 '22 07:08 sharkdp

Okay, then I'll try to work on Node 10 support.

triallax avatar Aug 02 '22 09:08 triallax

There's also this warning on older versions of npm (6.14.4)

npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but npm-shrinkwrap.json was generated for lockfileVersion@2. I'll try to do my best with it!

sharkdp avatar Aug 02 '22 20:08 sharkdp

I noticed that too in my Node 10 testing. It doesn't sound like we strictly need to fix it, but I'll try anyway.

triallax avatar Aug 02 '22 20:08 triallax

An alternative route here would be to re-introduce some sort of bundling into a binary, like we did with nexe previously. If we can ship an insect executable (with a recent version of Node.js inside) that runs on older Ubuntu versions, that would also be fine for me.

sharkdp avatar Aug 02 '22 20:08 sharkdp

I believe I was able to make Insect runnable with Node 10, but I want to know whether we want to support Node 10 for development too? In other words, do we also want to allow running npm run build with Node 10, or do we only want to allow using insect from npm?

Edit: esbuild actually only supports Node 12 and above, though after some small modifications I was able to run npm run build with Node 10 just fine anyway. What do you think?

Edit 2: with the modifications to allow running npm run build on Node 10, I couldn't run it on Node 18.

triallax avatar Aug 03 '22 19:08 triallax

I believe I was able to make Insect runnable with Node 10, but I want to know whether we want to support Node 10 for development too? In other words, do we also want to allow running npm run build with Node 10, or do we only want to allow using insect from npm?

Using insect would be more than enough - thanks!

sharkdp avatar Aug 14 '22 14:08 sharkdp