I've been using mjml for a little while and I wanted to install it on my laptop. So I followed the steps on the official webpage but I got an error when I try to run it.
"bash: ./node_modules/.bin/mjml: No such file or directory"
After that I tried to run this code
export PATH="$PATH:./node_modules/.bin"
When I try to run it again using $ mjml -r index.mjml I got the following error:
mjml: command not found
My node version is v7.8.0 Also, my nodejs version is v6.10.2
I'll appreciate any comment and help, thank you.
@terepaima
~/.bash_profilewhich node command?@terepaima, you can also try to run npm init (press Enter to every prompt) before running npm install mjml.
You can do npm init -y to avoid the prompt. You should create a directory like mjml-workspace or something
@ fusion27
I'm using a laptop that used to have windows 10 but I change completely to Ubuntu.
The result is -bash: /home/terepaima/.bash_profile: Permission denied
I tried to run it with sudo and I got sudo: /home/terepaima/.bash_profile: command not found
With which node here's what I got:
Command 'which' is available in the following places
I run npm init then npm install mjml, here's the result
[email protected] /home/terepaima
└── [email protected]
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"ia32"})
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
When I try tu run mjml I still got the same error :(
Thanks all for your help :)
Do cat ~/.bash_profile you tried to execute it here :)
You should remove your node_modules & package.json from your home and do a directory like mjml_workspace then you can redo npm init -y and npm install mjml and then you can use MJML with ./node_modules/.bin/mjml
@terepaima - love me some Linux, good form 🐧
~/.bashrc for bash customizations, try taking a look there./usr/bin/which nodeThanks @iRyusa, I tried what you said and now I'm able to use ./node_modules/.bin/mjml index.mjml Inside my mjml_workspace folder. I tried to use export PATH='$PATH:./node_modules/.bin' to only use a mjml command but I still got the same error.
For know I'm fine with the results, I only need to use it with ./node_modules/.bin/mjml index.mjml
I'm closing this one then !
If you've got trouble with local install you can still use global install at your own risk !
:+1:
I got same error on my windows so i tried installing it globally using the command npm -g install mjml and everything works fine, no need to run npm init in the project directory unless you're using it for something else
Most helpful comment
Do cat ~/.bash_profile you tried to execute it here :)
You should remove your node_modules & package.json from your home and do a directory like
mjml_workspacethen you can redonpm init -yandnpm install mjmland then you can use MJML with./node_modules/.bin/mjml