jco icon indicating copy to clipboard operation
jco copied to clipboard

Node version gives confusing error messages

Open kaspar-p opened this issue 1 year ago • 1 comments

Using LTS node 18 means that import.meta.resolve is not defined. During the searching for preview2-shim this throws an error, but is swallowed by the message:

Unable to locate the {bold @bytecodealliance/preview2-shim} package, make sure it is installed.

when the actual error is something like

(intermediate value).resolve is not a function

Can the error also be printed, and the docs made clear about required versions of Node?

kaspar-p avatar Sep 24 '24 14:09 kaspar-p

The latest version of Node.js 18 does support this, but agreed it would be nice to improve the error message as well. Perhaps just a check of if (!import.meta.resolve) console.error('Latest Node.js 18 or newer must be used') or something like that?

guybedford avatar Sep 24 '24 17:09 guybedford