-
-
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
Running scripts without extensions errors if they are on a RO filesystem #176
Comments
In order to run it, zx create in same folder file with + .mjs extension. So file system should be writable. |
Even for FHS linux this is a very hard limitation. This basically disallows installing ZX scripts (without aa filending) at the system level, eg. in The file could as well be written to Currently I'm helping myself by having the |
At first, zx used tmp dir to write mjs file. But from this destination relative imports will not work. |
Thats in general an understandable limitation. Is there any technical reason for renaming the file at all? |
Nodejs can't import or require it without extension. |
It actually can: https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_customizing_esm_specifier_resolution_algorithm As you can see 14+ can definitely import without extension, albeit with an experimental tag |
My current use case doesn't involve any require or import at all, yet. Though currently I prefer the manual wrapping I currently do over using an experimental feature of a runtime I am not used to use. Lets just close this issue then as a "wont fix", as it is not fixable. A fix can be done once the mentioned feature has stabilized. |
Expected Behavior
No error when running a script without extension from a read only filesystem.
Actual Behavior
An error when running a script without extension from a read only filesystem.
Steps to Reproduce the Problem
xz
script without extension but with proper shebang on a read-only filesystemSpecifications
The text was updated successfully, but these errors were encountered: