cwjohan / markdown-to-html

Command-line utility to convert Github Flavored Markdown to HTML.
MIT License
236 stars 86 forks source link

Bad interpreter and bad encoding #2

Closed hsanjuan closed 7 years ago

hsanjuan commented 9 years ago

The interpreter is set to #!node when it should be to #!/usr/bin/env node

Additionally the npm-installed file for /usr/bin/markdown file is DOS encoded, which causes a "Wrong interpreter node^M" messages like: bash: /usr/bin/markdown: /usr/bin/node^M: bad interpreter: No such file or directory

curcuz commented 9 years ago

+1

gka commented 9 years ago

+1

you should use something like

#!/usr/bin/env node

instead of

#!node
gka commented 9 years ago

ah, no this seems to be a end-of-line character issue!

https://github.com/mllrsohn/node-webkit-builder/issues/75

brownmike commented 9 years ago

This comment on another issue solved the problem quite nicely for me https://github.com/nwjs/nw-builder/issues/75#issuecomment-55108563

Open the executables in VIM and use

:set ff=unix
cwjohan commented 9 years ago

People suggesting solutions need to tell us what their environment is and which environments they have tested to ensure the solution is portable. There are people using just about every environment possible and we need a solution that works in every environment. If it breaks some other environment or breaks merges, we'll just get more bug reports.

But thanks, Mike, for the ": set ff=unix" workaround. That should work for some people who have the problem and just want to get their script working.

On Mon, Aug 17, 2015 at 11:38 AM, Brown Mike notifications@github.com wrote:

This comment on another issue solved the problem quite nicely for me nwjs/nw-builder#75 (comment) https://github.com/nwjs/nw-builder/issues/75#issuecomment-55108563

Open the executables in VIM and use

:set ff=unix

— Reply to this email directly or view it on GitHub https://github.com/cwjohan/markdown-to-html/issues/2#issuecomment-131920422 .

Karlheinzniebuhr commented 8 years ago

+1 I'm getting this on OS X Yosemite 10.10.5


>markdown
>node^M: bad interpreter: No such file or directory
>markdown --help
>node^M: bad interpreter: No such file or directory
adrianhelvik commented 8 years ago

+1 Getting it on OS X 10.9.5

$ markdown readme.md 
-bash: /usr/local/opt/nvm/versions/node/v4.0.0/bin/markdown: node^M: bad interpreter: No such file or directory

Same issue with node v0.12.7 and v4.0.0

MichaelJCole commented 8 years ago

Same issue in Linux Mint. Would be awesome if it did :-)

MichaelJCole commented 8 years ago

See also: https://github.com/pwlmaciejewski/markdown-html

iambmelt commented 8 years ago

+1 OS X Yosemite 10.10.5

corsica commented 8 years ago

+1, Linux

jkatsnelson commented 8 years ago

+1 OS X Yosemite 10.11.12

gnujeremie commented 8 years ago

+1 OS X El Capitan 10.11.3

oimou commented 8 years ago

+1 OS X El Capitan 10.11.2

twitchard commented 8 years ago

+1 archlinux

ghost commented 8 years ago

+1 Linux Mint 17.3 Cinnamon 64 bit

louis993546 commented 8 years ago

+1 OS X El Capitan 10.11 Beta (15A278b)

rijnhard commented 8 years ago
dos2unix script_name.js

done

molomby commented 8 years ago

+1 -- OS X El Capitan 10.11.5 (15F34)

Obooman commented 7 years ago

+1 OS X EL Capitan 10.11.6(15G31)

$ github-markdown index.md
$ zsh: /usr/local/bin/github-markdown: bad interpreter: node^M: no such file or directory
smlombardi commented 7 years ago

+1 also on 10.11.6 (15G1004)

-bash: /Users/stevelombardi/.nvm/versions/node/v6.4.0/bin/markdown: node^M: bad interpreter: No such file or directory
cwjohan commented 7 years ago

Can you not add /usr/bin/env to your path?

On Tue, Sep 13, 2016 at 5:50 AM, Steve Lombardi notifications@github.com wrote:

+1 also on 10.11.6 (15G1004)

-bash: /Users/stevelombardi/.nvm/versions/node/v6.4.0/bin/markdown: node^M: bad interpreter: No such file or directory

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cwjohan/markdown-to-html/issues/2#issuecomment-246670859, or mute the thread https://github.com/notifications/unsubscribe-auth/AH5q3GTg36mjTHrB1IbH12v0rBG8eTigks5qppwxgaJpZM4E6Wjw .

jacksonrayhamilton commented 7 years ago

+1 on Debian 8.5

There seems to be ample evidence that this problem will be fixed by accepting some of the open pull requests. I am pretty sure npm creates a wrapper batch script in Windows that calls the program with node. Lots of bin scripts use #!/usr/bin/env node and work fine on Windows.

cwjohan commented 7 years ago

OK. Done. We now are using "#!/usr/bin/env node".

cwjohan commented 7 years ago

Accepted user critiques. We now are using "#!/usr/bin/env node".