Search code examples
cygwinatom-editor

Problems using apm and atom editor command in cygwin


Currently can't get the apm command to work with cygwin, below is what I've been trying to do apm --version and getting these errors:

/cygdrive/c/Users/Nat/AppData/Local/atom/bin/../app-1.3.2/resources/cli/apm.sh: line 2: $'\r': command not found

/cygdrive/c/Users/Nat/AppData/Local/atom/bin/../app-1.3.2/resources/cli/apm.sh: line 4: /cygdrive/c//../app/apm/bin/node.exe: No such file or directoryrces/cli

I also made sure to add the location of the apm and atom cmd to my path variable but it is still not working. Currently trying this on windows 7 using cygwin64 terminal.

EDIT:

For some reason it works on windows cmd but not cygwin not sure what the difference could be that is making it so it won't work on cygwin but will on cmd.


Solution

  • Have you tried running atom.cmd? You can also try running dos2unix on the script from the error message.

    source: https://github.com/atom/atom/issues/9169

    EDIT:

    '\r' characters (usually used for new lines in Windows) tend to cause trouble in cygwin. You can try stripping it by using dos2unix command. However, you might run into a different problem (with path like mosbth did in the source link above) if you do.

    atom.cmd should run smoothly on cygwin.

    According to apjanke from the source:

    atom.cmd is known to be a native Windows program, based on file extension (I think), so automagic Cygwin->Windows path translation happens when you invoke it from a shell running under Cygwin. Plain atom is a shell script, which runs in the Cygwin Unix space, so automagic path translation doesn't happen.

    (I apologize for the previously unexplained answer. I would've commented under the question, but I'm not privileged yet.)