Should we add a PATH warning notice ?
IfnotFr opened this issue · comments
I think It may be usefull to add a notice in the documentation or in the readme for informing users that a valid PATH is required on the current env while uzing
zx my-script.mjs is working out of the box in terminal, but if you are trying to call zx scripts from a systemd service, or dhcpcd run hooks (in my particular case) the PATH may be not available and neither
zx may be found.
I think this can be a common case and can bring misconfusion to beginner / average linux users like me.
Add a new block like this on the readme (this is a first shot and may be not fully corect, improvements are welcome) :
My script is not running from systemd service or other background-related context.
Make sure your PATH environment variable of your service/script has the npm bin folder. If you cant set the PATH, you can also make symlinks of
zx to a binary folder:
sudo ln -s $(which node) /usr/local/bin/node sudo ln -s $(which zx) /usr/local/bin/zx
Well. This is pretty basic Linux 101. I think we don't need this in the readme.