jco
jco copied to clipboard
Node version gives confusing error messages
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?
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?