Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find 'php-cs-fixer'. The program may not be installed. #584

Closed
EvKoh opened this issue Oct 2, 2015 · 7 comments
Closed

Could not find 'php-cs-fixer'. The program may not be installed. #584

EvKoh opened this issue Oct 2, 2015 · 7 comments
Labels
Milestone

Comments

@EvKoh
Copy link

EvKoh commented Oct 2, 2015

See https://github.com/FriendsOfPHP/PHP-CS-Fixer for program installation instructions.
Your program is properly installed if running 'which php-cs-fixer' in your Terminal returns an absolute path to the executable. If this does not work then you have not installed the program correctly and so Atom Beautify will not find the program. Atom Beautify requires that the program be found in your PATH environment variable.
Note that this is not an Atom Beautify issue if beautification does not work and the above command also does not work: this is expected behaviour, since you have not properly installed your program. Please properly setup the program and search through existing Atom Beautify issues before creating a new issue. See https://github.com/Glavin001/atom-beautify/search?q=php-cs-fixer&type=Issues for related Issues and https://github.com/Glavin001/atom-beautify/tree/master/docs for documentation. If you are still unable to resolve this issue on your own then please create a new issue and ask for help.

Error: Could not find 'php-cs-fixer'. The program may not be installed.
at PHPCSFixer.module.exports.Beautifier.commandNotFoundError (/home/dev/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:178:14)
at /home/dev/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:274:25
at tryCatcher (/usr/share/atom/resources/app.asar/node_modules/babel-core/node_modules/bluebird/js/main/util.js:26:23)
at Promise._settlePromiseFromHandler (/usr/share/atom/resources/app.asar/node_modules/babel-core/node_modules/bluebird/js/main/promise.js:507:31)
at Promise._settlePromiseAt (/usr/share/atom/resources/app.asar/node_modules/babel-core/node_modules/bluebird/js/main/promise.js:581:18)
at Promise._settlePromises (/usr/share/atom/resources/app.asar/node_modules/babel-core/node_modules/bluebird/js/main/promise.js:697:14)
at Async._drainQueue (/usr/share/atom/resources/app.asar/node_modules/babel-core/node_modules/bluebird/js/main/async.js:123:16)
at Async._drainQueues (/usr/share/atom/resources/app.asar/node_modules/babel-core/node_modules/bluebird/js/main/async.js:133:10)
at MutationObserver.Async.drainQueues (/usr/share/atom/resources/app.asar/node_modules/babel-core/node_modules/bluebird/js/main/async.js:15:14)
at process._tickCallback (node.js:365:9)

which php-cs-fixer ---> null

capture d ecran de 2015-10-02 22 40 27

@Glavin001
Copy link
Owner

@EvKoh :

If you run which php-cs-fixer and it does not return a path then it was not installed properly. You should see https://github.com/FriendsOfPHP/PHP-CS-Fixer to install the executable.

apm install php-cs-fixer

You just installed another package: https://atom.io/packages/php-cs-fixer
Did you read the error message instructions and look at https://github.com/FriendsOfPHP/PHP-CS-Fixer for the installation instructions?

Please follow the instructions that Atom Beautify tells you to follow:

See https://github.com/FriendsOfPHP/PHP-CS-Fixer for program installation instructions.
Your program is properly installed if running 'which php-cs-fixer' in your Terminal returns an absolute path to the executable. If this does not work then you have not installed the program correctly and so Atom Beautify will not find the program. Atom Beautify requires that the program be found in your PATH environment variable.
Note that this is not an Atom Beautify issue if beautification does not work and the above command also does not work: this is expected behaviour, since you have not properly installed your program. Please properly setup the program and search through existing Atom Beautify issues before creating a new issue. See https://github.com/Glavin001/atom-beautify/search?q=php-cs-fixer&type=Issues for related Issues and https://github.com/Glavin001/atom-beautify/tree/master/docs for documentation. If you are still unable to resolve this issue on your own then please create a new issue and ask for help.


@vitkabele :

I think its neccessary to change the PHP-cs-fixer execution path
You are correct. If you run which php-cs-fixer and it does not work and returns without displaying the path for the php-cs-fixer executable then you need to setup your PATH environment variable.

I'd recommend taking a read of some of the other related issues if you need more help: https://github.com/Glavin001/atom-beautify/search?q=php-cs-fixer&type=Issues

@Glavin001
Copy link
Owner

I am closing this issue because the instructions given in the error were obviously not followed.

The first line of the error's instructions were:

See https://github.com/FriendsOfPHP/PHP-CS-Fixer for program installation instructions.
And instead apm install php-cs-fixer was run.

Please re-read the errors that have been written to help you.

@Glavin001 Glavin001 added this to the v0.29.0 milestone Oct 5, 2015
@vitkabele
Copy link

Hey i'm not so stupid. I did so, then i posted the comment

@Glavin001
Copy link
Owner

I did so, then i posted the comment

@vitkabele , if you were referring to the comment:

I am closing this issue because the instructions given in the error were obviously not followed.

That was not aimed at you. I expect you did follow the installation instructions at https://github.com/FriendsOfPHP/PHP-CS-Fixer and you did not run apm install php-cs-fixer, which was not indicated in any of the installation documentation.

For you (and anyone else for that matter), I had recommended reading the other related Issues as it will help answer your questions and with fixing your PATH environment variable such that Atom Beautify can detect your php-cs-fixer executable path.
You can manually set the absolute path to your php-cs-fixer executable using the PHP-CS-Fixer Path option: https://github.com/Glavin001/atom-beautify/blob/master/docs/options.md#php---php-cs-fixer-path

It depends on if you are running on Windows or Mac/Linux.

Here are some steps:

  • Run (Mac/Linux) which php-cs-fixer or (Windows) where php-cs-fixer in your shell to retrieve the path to your executable path
    • If this does work and returns a path, then your PATH environment variable is working and setup. Try to restart Atom and see if that helps, it may need to reload your PATH environment variable.
    • If this does not return a valid path, then your PATH environment variable is not working and not yet setup properly. Depending on your operating system, Windows or Linux or Mac, you will have to add the path of your php-cs-fixer's installation path to your PATH environment variable. Read issues from the links above or Google for more help.

@ipranjal ipranjal mentioned this issue Sep 25, 2016
4 tasks
@Glavin001
Copy link
Owner

I really want to focus on improving the installation experience for users. I have created a new Issue, #1687, to target this problem. Please provide your feedback! Thanks in advance.

@phamthanhnghia
Copy link

phamthanhnghia commented Jan 31, 2018

I fixed this. You need uninstall atom-beautify

@sravanikadali69
Copy link

Hi Team,
Can Php fixer CS can be used on Xcode.
Your reply would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants