mjml: -bash: mjml: command not found

So I’m following the MJML documentation for basic installation. I successfully install. I run npm list in my project folder and MJML appears there.

However, when I run mjml -v the following error appears -bash: mjml: command not found

Terminal output for when I run which Node /usr/local/bin/node

Content of my .bashrc is empty at the moment. I previously added export PATH="$PATH:./node_modules/.bin" but this made no difference.

Using a Macbook air, High Sierra and Terminal.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (9 by maintainers)

Most upvoted comments

Yeah so your $PATH isn’t updated, I don’t know why it doesn’t read your bashrc/bashprofile and there’s not really much we can do about this 😕

Sorry, but I’m closing the issue.

I too had this issue. Running mjml input.mjml -o output.html doesn’t work.

However, in my package.json adding a command like "compile":"mjml input.mjml -o output.html" works

If you’ve installed it locally just use npm-exec mjml or yarn mjml it’s now the safest way to use cli binary

On Wed, May 29, 2019 at 2:47 AM TidyIQ notifications@github.com wrote:

Same issue here. Did you ever get this fixed?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/mjmlio/mjml/issues/885?email_source=notifications&email_token=AAELHTOVDUORW7YJU775FRTPXXHCBA5CNFSM4EDYV6AKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWN22PA#issuecomment-496741692, or mute the thread https://github.com/notifications/unsubscribe-auth/AAELHTOR26JOOJZVKKY7AP3PXXHCBANCNFSM4EDYV6AA .

@sasha150187 From what it sounds like, I have a similar setup to @kostimarko. Put the script in the scripts section of package.json.

It’d look something like this:

// package.json
...
"scripts": {
    "start": // some other script,
    "compile": mjml input.mjml -o output.html
}
...

@probablyabear you got to it before me 😃

@sasha150187 From what it sounds like, I have a similar setup to @kostimarko. Put the script in the scripts section of package.json.

It’d look something like this:

// package.json
...
"scripts": {
    "start": // some other script,
    "compile": mjml input.mjml -o output.html
}
...

Thats the first thing I usally do @iRyusa

Steps:

  1. Created new folder on desktop test-email
  2. Ran npm init
  3. Ran npm install mjml
  4. Ran npm list – I can see mjml and all it dependencies.
  5. I can node modules folder now
  6. Ran mjml -v result is -bash: mjml: command not found
  7. Ran ./node_modules/.bin mjml -V result is -bash: ./node_modules/.bin: is a directory

Do I create .bash_profile or .bashrc on my platform?