-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
MJML not found with NVM setup #83
Comments
@AlecRust I don't use yarn, so I've never tested But other contributors have added yarn support, here's where it's checked: https://github.com/sighmon/mjml-rails/blob/master/lib/mjml.rb#L67 Looking at the way we look for a valid yarn mjml binary, can you see anywhere where it might be failing for your setup? def self.check_for_yarn_mjml_binary
yarn_bin = `which yarn`.chomp
return unless yarn_bin.present?
mjml_bin = "#{yarn_bin} run mjml"
return mjml_bin if check_version(mjml_bin)
end |
Thanks @sighmon. I see that code runs
This is standard based on the NVM/npm installed Yarn setup described above, however sometimes when I run /Users/alec/.nvm/versions/node/v16.2.0/bin/yarn Looks like the check code would work for a Homebrew or manual Yarn installation which adds |
OK, figured out what is causing this. I had I have disabled this, but I don't seem to have this issue with other gems or Node packages. A very crude solution would be to include this command in your gem before the code that runs source "$NVM_DIR/nvm.sh" |
Causes `which yarn` within mjml-rails gem to return a function instead of path. sighmon/mjml-rails#83
Background
After a format of my machine and careful new setup via my dotfiles, I have Node installed only via NVM (no duplicate Homebrew Node version at
/usr/local/node
) and have installed global Node packages using npm with the recommended approach. This includes Yarn, which they recommend installing via npm.Point being I'm fairly confident I have a "clean" Node setup with no duplicates, everything installed as-per docs and scoped to the chosen NVM Node version.
Problem
I have
mjml
in my project'spackage.json
and have ranyarn
.But I get this error from mjml-rails:
Even if make MJML a global package with
npm install -g mjml
I get the same error.I'm not sure if local project
npm install mjml
works, but we use Yarn instead. Does mjml-rails rely on local project npm usage instead of Yarn?The text was updated successfully, but these errors were encountered: