Hacker News new | ask | show | jobs
by catapart 3 hours ago
EDIT: This was my fault. My machine did not take the update well and I did not confirm that the update worked before complaining about it (burned once before, so I was biased). After testing on a secondary machine and then forcing the upgrade on the initial machine, both machines ran both projects just fine. Great job by the devs! Sorry for the misinformation here.

Original message: --------------------------------

I just tried to migrate using their `deno install` -> `deno task dev` instructions, and I got an error about vite needing a newer version of Node.

I'm not pathologizing deno, and I have (and will continue to) consistently tried to migrate my projects to deno, first from npm, then from pnpm, and now from bun. But every single time I've tried, there has been some kind of stupid "edge case", "simple fix" issue like this that stops me in my tracks. It's not a huge deal, but the simple fact is, when I run the project using bun, it runs. When I try it using deno, it doesn't. That has been a consistent pattern every single time I've tried. Last time, deno blew up because it wasn't able to work out the IndexedDB api calls I was using without some kind of bridge/shim/environment config. These are terribly minor issues, but it's the lack of care for the details that really sours me on this stuff.

Obviously, deno should have used the version of vite that bun did which would have worked with the version of node on this machine. But even barring that, they could have dropped a little note around the instructions that says "if some packages need updates, you can run X command to do that". Even that would have allowed me to just move on, instead of forcing me to query the solution and hope for the best. Like I said, none of this is damning. It's just the exact kind of friction that prevents immediate adoption. At least for me.

1 comments

Gee, sorry to hear that. It's Bartek from the Deno team here. This is really a whack-a-mole. We currently present the latest stable Node.js version (26.3.0) so the error is not correct - I bet it's probing for something stupid like no of arguments a certain function supports. Is your project open source so I can take a look myself?
unfortunately, while the project is in the public domain, it's pre-alpha so I haven't made the repo public yet.

but the project is structured the same as another public domain project I've built, and I just checked to make sure it has the same issue. I've gone ahead and made that project public so you can give it a try[0].

but, just to be clear, I don't think the message is wrong? The Node version on this machine is out of date. And when comparing the deno.lock file to the bun.lock file, I can see that the deno.lock has a slightly newer version (8.1 vs 8.0) of vite. So I think the message could be correct and is just telling me to update my version of Node, which is perfectly reasonable. It's just the discrepancy between not needing the newer version of vite/node on bun while invoking an error using deno. Feels like I should have either gotten perfectly matching versions, or error messages (with commands) to update node.

in any case, if you're still interested in seeing the error yourself, my steps were: 1. clone the repo 2. run deno install 3. run deno task dev

[0] https://gitlab.com/cynic-devs/magnitce-code-example

What node version do you have installed? I cannot reproduce the issue on that repo, I've tried with node versions all the way back to node 12.
here's a dump of the console:

```

catapart@snake:~/Development/magnitce-code-example$ deno install

Warning The following packages are deprecated:

┖─ npm:boolean@3.2.0 (Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.)

catapart@snake:~/Development/magnitce-code-example$ deno task dev

Task dev vite

You are using Node.js 20.11.1. Vite requires Node.js version 20.19+ or 22.12+. Please upgrade your Node.js version. error: Uncaught (in promise) SyntaxError: The requested module 'node:util' does not provide an export named 'parseEnv' at file:///home/catapart/Development/magnitce-code-example/node_modules/.deno/vite@8.1.0/node_modules/vite/dist/node/chunks/node.js:11:46

    at async CAC.<anonymous> (file:///home/catapart/Development/magnitce-code-example/node_modules/.deno/vite@8.1.0/node_modules/vite/dist/node/cli.js:706:27)
```

also: I'm using Linux Mint, if it matters.

Okay I traced it, the problem is in `node_modules/vite/dist/node/cli.js`:

``` function checkNodeVersion(nodeVersion) { const major = parseInt(nodeVersion.split(".")[0], 10); const minor = parseInt(nodeVersion.split(".")[1], 10); return (major === 20 && minor >= 19) || (major === 22 && minor >= 12) || major > 22; } if (!checkNodeVersion(process.versions.node)) console.warn(`You are using Node.js ${process.versions.node}. Vite requires Node.js version 20.19+ or 22.12+. Please upgrade your Node.js version.`); ```

And that error should be thrown only in Deno < 2.2 which presented `process.version` as `20.11.1`.

Are you 100% sure this is not running some old version of Deno on your system?

you nailed it! I tried it on a different machine, just to be sure, and it worked without a problem. So then I did a full restart on the mint machine and I got a whole new error that was talking about missing files. So I uninstalled deno and reinstalled it, and it worked exactly like it did on the other machine.

I actually started this after another user said they couldn't reproduce the issue, but you figured it out before I finished reporting back.

Thanks for straightening me out on this! As I said a few days ago on the Deno Desktop HN Topic, I'm looking forward to this newest version!

The release notes here indicate that if a script shells out to node and you have a node installed Deno lets the installed node run instead of its own shim.
You can have AI do way more automated testing in a loop, let cheap models run 24/7 so all edge cases can be found over time by pulling random repos, you must make sure the agent is entirely autonomous, ask another agent to make a list (also in a loop so it keeps appending to it) and another agent that try to fulfill "run it with Deno".
I think node already does this (sans AI), idk where the code lives but deno could probably just use the same list of repos
You're getting downvoted because "AI bad" but this is actually a good idea.
Because none of that requires "AI". You can use a script to clone GitHub top NPM repos (by whatever measure), and then 'simply' try to migrate them to Deno and log all the errors and warnings. Maybe you compile those errors in a neat list with an LLM, and ask it to emphasize things it considers important. But even that can be done inside the script with loglevels and maybe some regex.

Parent is getting downvoted because they're suggesting something that is akin to "why are you running this simple, reliable, efficient Python script instead of feeding inputs to an LLM and praying you get the outputs you want".

Respect yourself by respecting your craft.

A script made by AI, digested by AI, organized by AI? Let's call it what it is.