-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is Node.js 12.17.0 supported for zx as a package ? #824
Comments
Ok, I've found a workaround for Node.js 12, by using import {createRequire} from 'node:module';
const require = createRequire(import.meta.url);
const {$, cd} = require('zx'); I think the top level await in built index.js is not compatible with Node.js 12, should work starting with Node.js 14.8. |
Nice catch, thanks! |
closes #824 Co-authored-by: Anton Medvedev <anton@medv.io>
Fix does not seem to work, I'm still getting the same error. According to documentation, Node.js 12 does support the exports entrypoint, see https://nodejs.org/docs/latest-v12.x/api/packages.html#packages_package_entry_points |
What a weird thing: it supports the |
Check another patch plz: 8.1.2-dev.b3fcad2 |
It works ! :) |
Thanks a lot for the quick fixes :) |
Hello !
I've seen the releases notes of 8.1.0 which says
However with Node.js 12.22.12 (the one shipped with alpine 3.20, upon which docker-cli images are built), I'm getting
SyntaxError: Unexpected reserved word
withimport {$, cd} from 'zx';
What I'm trying to achieve: I'm trying to run mocha tests (using mocha binaries), which starts and stops Docker containers, so I'm using zx as a package. And since I also need docker client, I'm using the docker-cli image, with alpine 3.20, which provides Node.js 12.22.12.
It is expected to work ? Anything I can to do work around it ?
Thanks
Expected Behavior
No error
Actual Behavior
SyntaxError: Unexpected reserved word
Steps to Reproduce
Specifications
The text was updated successfully, but these errors were encountered: