Tuesday, 11 May 2010

How to Fix Emacs Windows Error - Spawning Child Process - Invalid Argument

Emacs Error Message - spawning child process: invalid argument
  • When you call the shell
  • When you call the compiler, such as mingw32-make
Details
  • Emacs Version 23.1 for Windows
  • Windows XP Professional Service Pack 3
  • Powershell Version 1
Solution
  1. Go to the windows console
  2. Enter the command "set" to bring up your system variables
  3. I had shell=c:\progra~1\rational\ration~1\nutcroot\mksnt\sh.exe
  4. Enter "set shell=" to remove the variable
  5. Try Emacs again
Tips
  • Anonymous commentator (18/6/11) found the cause of the error to be a different environmental variable, MKS. I suggest that you examine your other environmental variables if changing SHELL or MKS does not work for you.
Notes
  • This took me a long time to fix and a caused me a lot of stress
  • Please leave a comment if you found this useful

7 comments:

  1. Thanks for sharing your fix to the problem.

    ReplyDelete
  2. Hi Anonymous,

    Thanks for leaving a comment. Much appreciated :)

    ReplyDelete
  3. Thank you so much for sharing and saving me a lot of trouble.

    ReplyDelete
  4. Hi Anonymous,

    Glad you found this useful. It was driving me nuts for quite a while.

    ReplyDelete
  5. I got the same error message. Although the exact fix is a little bit different: the MKS environment variable was pointing to the wrong place, this article nevertheless did give me some hint as where to look.

    Thank you.

    ReplyDelete
  6. Thanks anonymous (18/6/11) for leaving a comment about your experience. I wonder what the MKS variable is for Windows and for Emacs.

    ReplyDelete
  7. Hi Frazer,

    My parents are Vietnamese and I was born in Melbourne Australia.

    ReplyDelete