06 November 2014


When executing ./bin/drush within a composer-managed project on Linux, I received this error:

# ./bin/drush
: No such file or directory


Eventually, it became apparent that the drush script was failing to execute because it could not find the interpretter. The cause became apparent with this debug info:

head -1 ./vendor/drush/drush/drush | od -c
0000000   #   !   /   u   s   r   /   b   i   n   /   e   n   v       s
0000020   h  \r  \n

As you can see, there is a carriage return (\r), which means that the Linux shell script had Windows line-endings. The \r character prevented proper discovery of the interpretter.


  1. Edit ~/.gitconfig (or other git config file) to add autocrlf=input.
  2. Delete ./vendor/drush/drush folder
  3. Update using composer to clone a fresh copy of drush with proper line endings.
# cat ~/.gitconfig
  autocrlf = input
... (your other settings)
# rm -rf ./vendor/drush/drush
# composer update

blog comments powered by Disqus