Atom-beautify: PHP-CS-Fixer throws "Error: spawn EACCES"

Created on 10 Oct 2016  路  4Comments  路  Source: Glavin001/atom-beautify

Description

The results of beautification are not what I expect.

Expected Results

The beautified code should have looked like:

<INSERT CODE HERE>

Steps to Reproduce

  1. Add code to Atom editor
  2. Run command Atom Beautify: Beautify Editor
  3. This beautified code does not look right!

    Debug

Here is a link to the debug.md Gist: https://gist.github.com/e9b1ea1349ffa8d0fbf2035fb49fe1fc

Checklist

  • [ ] I have tried uninstalling and reinstalling Atom Beautify to ensure it installed properly
  • [ ] I have reloaded (or restarted) Atom to ensure it is not a caching issue
  • [ ] Searched for existing Atom Beautify Issues at https://github.com/Glavin001/atom-beautify/issues
    so I know this is not a duplicate issue
  • [ ] Generated debugging information and added link for debug.md Gist to this issue
linux question

Most helpful comment

Changing file permissions did not resolve this for me. I continued to get this message until I realized that I needed to specify the full file path for php-cs-fixer in the atom-beautify package settings. Before, I was just specifying the directory path (e.g. I was specifying the executable path as /Users/me/.composer/vendor/bin instead of /Users/me/.composer/vendor/bin/php-cs-fixer).

Silly me, but maybe someone else will make the same mistake and see this.

All 4 comments

2016-10-10T12:31:44.158Z - debug: [beautifiers/beautifier.coffee] spawn /usr/local/bin/php-cs-fixer 0=fix, 1=/tmp/temp116910-1931-cm1hra
2016-10-10T12:31:44.189Z - debug: [beautifiers/beautifier.coffee] error Error: spawn EACCES

The error is Error: spawn EACCES and you may need to change the file permissions so it is executable: http://stackoverflow.com/a/19026627/2578205

sudo chmod -R a+rwx /usr/local/bin/php-cs-fixer

Changing file permissions did not resolve this for me. I continued to get this message until I realized that I needed to specify the full file path for php-cs-fixer in the atom-beautify package settings. Before, I was just specifying the directory path (e.g. I was specifying the executable path as /Users/me/.composer/vendor/bin instead of /Users/me/.composer/vendor/bin/php-cs-fixer).

Silly me, but maybe someone else will make the same mistake and see this.

@trevorhreed What OS are you on?

MacOS (High Sierra)

Was this page helpful?
0 / 5 - 0 ratings