Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

spawn ENOENT #6

Closed
Cipa opened this issue Aug 15, 2014 · 14 comments
Closed

spawn ENOENT #6

Cipa opened this issue Aug 15, 2014 · 14 comments
Labels

Comments

@Cipa
Copy link

Cipa commented Aug 15, 2014

Just installed and the console opens every time I open a php file.

Here is what I see when I start atom by clicking index.php in a project.
Atom 0.122.0/ MaxOs 10.9.4

screen shot 2014-08-15 at 9 47 11 am

Any ideas?

Thanks

@dmnd dmnd changed the title Just installed and the console opens every time I open a php file spawn ENOENT Aug 18, 2014
@dmnd
Copy link
Member

dmnd commented Aug 18, 2014

See common errors, and if you think your problem is new then reply and I'll reopen this issue. I'm betting it's steelbrain/linter#150 though. You do have phpcs installed, right?

@dmnd dmnd closed this as completed Aug 18, 2014
@Cipa
Copy link
Author

Cipa commented Aug 21, 2014

Hi,

I have phpcs installed

pear install PHP_CodeSniffer
pear/PHP_CodeSniffer is already installed and is the same as the released version 1.5.4
install failed

and the problem seems like it's similar to the one you mentioned
I get an Uncaught Error: spawn ENOENT

Thanks

@dmnd
Copy link
Member

dmnd commented Aug 21, 2014

Did you try opening Atom from the command line as described in steelbrain/linter#150?

@Cipa
Copy link
Author

Cipa commented Aug 21, 2014

Yes, I get the same errors

tried both
atom Dropbox/Sites/startup/

and

cd Dropbox/Sites/startup/
atom

@dmnd
Copy link
Member

dmnd commented Aug 21, 2014

ok, reopening

@dmnd dmnd reopened this Aug 21, 2014
@Cipa
Copy link
Author

Cipa commented Aug 21, 2014

Thx, let me know if you need more details

@patrickmaciel
Copy link

I get the same error... I'm giving up.

@steelbrain
Copy link
Contributor

Fixed by #30

@Arcanemagus
Copy link
Member

Are you sure this was fixed in #30?

I am now getting the following on v1.0.1:

spawn phpcs ENOENT
Error: spawn phpcs ENOENT
  at exports._errnoException (util.js:734:11)
  at Process.ChildProcess._handle.onexit (child_process.js:1035:32)
  at child_process.js:1127:20
  at process._tickCallback (node.js:357:13)

However no further information is being shown in the console.

@steelbrain
Copy link
Contributor

@Arcanemagus it means that phpcs binary wasn't found in your $PATH. You can fix it by giving it the exact location to PHPCS in settings

@Arcanemagus
Copy link
Member

It looks like even though phpcs is in the $PATH, it needs to be explicitly told where it is on Windows.

PS C:\Users\Arcanemagus> where.exe phpcs
C:\php5\phpcs
C:\php5\phpcs.bat
PS C:\Users\Arcanemagus> phpcs --version
PHP_CodeSniffer version 2.3.2 (stable) by Squiz (http://www.squiz.net)
PS C:\Users\Arcanemagus> C:\php5\phpcs.bat --version
PHP_CodeSniffer version 2.3.2 (stable) by Squiz (http://www.squiz.net)

Setting the executable path to the full C:\php5\phpcs.bat causes it to work. I'm guessing it is simply trying phpcs and is not getting automatically expanded to phpcs.bat for some reason.

@steelbrain
Copy link
Contributor

I think that's a nodejs bug for windows. nodejs/node-v0.x-archive#2318

@Arcanemagus
Copy link
Member

Subscribed, thanks 😉.

@samirfor
Copy link

Thanks @steelbrain. I just did:

sudo apt-get install php-codesniffer

But should warn that too for the user in the error alert.

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

No branches or pull requests

6 participants