Closed soulseekah closed 4 months ago
Just encountered the same issue. Please fix ASAP⚡
@soulseekah Ah, thanks for opening this. Of course this broke npx and I assume pnpm dlx
as well. Would you mind opening a PR? I'm heading on vacation next week and won't have much time in a while for this.
@soulseekah Ah, thanks for opening this. Of course this broke npx and I assume
pnpm dlx
as well. Would you mind opening a PR? I'm heading on vacation next week and won't have much time in a while for this.
@sjelfull thanks for your support. PR is opened, hopefully we can polish and fine-tune the approach before your vacation and have a minor release ;)
Waiting for the PR, need it asap
Thanks, new release tagged!
@sjelfull - can this fix also be rolled into the Craft 4 version?
This commit https://github.com/superbigco/craft-mjml/commit/00db9a9048d3ca9d0c3bb024b4be7ab917541a40 introduces a regression and a breaking change in how
mjml
can be (and is) used withnpx
without a global installation, and also introduces friction in nvm-based environments.We used to be able to just supply the following configuration:
This now throws an exception. And forces us to:
/home/$HOME/.nvm/versions/node/v$VERSION/bin/node
).This severely limits a flexible setup with non-globally installation of mjml and node, and breaks usage via npx altogether.
Broken via https://github.com/superbigco/craft-mjml/issues/20
Code that breaks with
file_exists
https://github.com/superbigco/craft-mjml/commit/00db9a9048d3ca9d0c3bb024b4be7ab917541a40#diff-1639e3c1b104889ebfbeb509353e2334602ecad5d689941359b4166f2ff6720cR147-R156.There are several approaches in fixing this and I'm available to help solve this.
One of the easier ways, I believe, is to check all
PATH=
environment variables that are passed onto PHP to find the binaries. Ifnpx
is the binary, the mjml path should not be checked withfile_exists
.