This guide allows you to quickly setup an MJML environment. You'll need Node >=6 & NPM >3
1 - Create a new folder where you'll start working
$ mkdir mjml_workspace
$ cd mjml_workspace
$ npm init -y
2 - Now you can install either latest MJML version or beta with npm
#mjml beta
$ npm install mjml@beta
#mjml latest
$ npm install mjml
Now you can start compile MJML file with: ./node_modules/.bin/mjml my_file.mjml
Simply remove node_modules
folder from mjml_workspace
folder with rm -rf node_modules
, and repeat (2)
Add this to your ~/.bashrc
or ~/.zshrc
:
export PATH="$PATH:$(npm bin)"
Note: you should remove any global installation of MJML
to make this work