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

Error: spawn EACCES When I type something in php file #104

Open
XXiao12 opened this issue Feb 15, 2017 · 16 comments
Open

Error: spawn EACCES When I type something in php file #104

XXiao12 opened this issue Feb 15, 2017 · 16 comments
Labels

Comments

@XXiao12
Copy link

XXiao12 commented Feb 15, 2017

screen shot 2017-02-15 at 6 06 05 pm

Hello! I have just recently downloaded Atom and got packages for php, html, css, and haskell. I have been working on my php file a few day ago with no error, however today this error came up. I'm not sure if I'm missing packages or if my executable PATH is not right. What does this error mean?
Error: spawn EACCES
    at exports._errnoException (util.js:1026:11)
    at ChildProcess.spawn (internal/child_process.js:313:11)
    at exports.spawn (child_process.js:392:9)
    at /Users/Shirleyx/.atom/packages/linter-php/node_modules/sb-exec/lib/index.js:24:53
    at /Users/Shirleyx/.atom/packages/linter-php/node_modules/sb-exec/lib/index.js:23:18
    at next (<anonymous>)
    at step (/Users/Shirleyx/.atom/packages/linter-php/node_modules/sb-exec/lib/index.js:113:191)
    at /Users/Shirleyx/.atom/packages/linter-php/node_modules/sb-exec/lib/index.js:113:368

Community packages downloaded for php:
linter-php
linter-phpcs
linter-phpmd
php-cs-fixer
php-debug

Sorry if I am posting this in the wrong section

@Arcanemagus
Copy link
Member

Hmmm, usually that error pops up when a directory is put into the executable path, instead of the full path to the executable. Generally you should be able to leave it at the default (phpmd) and let your system resolve it, but if that isn't working for some reason you need to specify the full path.

You can find this on your system by running which phpmd.

@XXiao12
Copy link
Author

XXiao12 commented Feb 15, 2017

I am using a mac so would I type it in my terminal?
I got:

usage: which [-as] program ...

as the output

@XXiao12
Copy link
Author

XXiao12 commented Feb 16, 2017

I also tried npm install atom-linter@~4.6.1 from another thread:
└─┬ [email protected] invalid
└── [email protected]

@XXiao12
Copy link
Author

XXiao12 commented Feb 16, 2017

Error: spawn EACCES
    at exports._errnoException (util.js:1026:11)
    at ChildProcess.spawn (internal/child_process.js:313:11)
    at exports.spawn (child_process.js:392:9)
    at /Users/Shirleyx/.atom/packages/linter-phpmd/node_modules/sb-exec/lib/index.js:24:53
    at /Users/Shirleyx/.atom/packages/linter-phpmd/node_modules/sb-exec/lib/index.js:23:18
    at next (<anonymous>)
    at step (/Users/Shirleyx/.atom/packages/linter-phpmd/node_modules/sb-exec/lib/index.js:113:191)
    at /Users/Shirleyx/.atom/packages/linter-phpmd/node_modules/sb-exec/lib/index.js:113:368

@Arcanemagus
Copy link
Member

That version of atom-linter is quite old now, run npm update to bring it back to what it should be!

This should work just fine if you go into Settings -> Packages -> linter-phpmd and make sure the setting is on it's default value:
image

(The same goes for linter-phpcs)

@XXiao12
Copy link
Author

XXiao12 commented Feb 16, 2017

It says:

Error: Failed to spawn command phpmd. Make sure phpmd is installed and on your PATH

@Arcanemagus
Copy link
Member

Okay, that's progress at least.

What do you get when you run which phpmd?

@XXiao12
Copy link
Author

XXiao12 commented Feb 16, 2017

It returns nothing

@XXiao12
Copy link
Author

XXiao12 commented Feb 21, 2017

Error: Failed to spawn command `phpmd`. Make sure `phpmd` is installed and on your PATH
    at /Users/Shirleyx/.atom/packages/linter-phpmd/node_modules/atom-linter/lib/helpers.js:102:24
    at process._tickCallback (internal/process/next_tick.js:103:7)

@Arcanemagus
Copy link
Member

Hmm, I thought I read in your first post that you already had phpmd installed, but on re-reading it I don't see that, which would explain all your other issues.

Have you installed phpmd yet?

@XXiao12
Copy link
Author

XXiao12 commented Feb 22, 2017

yes I installed it, I forgot to include phpmd in the first sentence. Linter-phpmd is phpmd right?

@Arcanemagus
Copy link
Member

Arcanemagus commented Feb 22, 2017

Not quite, linter-phpmd is a wrapper around phpmd, allowing it to be automatically ran and the output transformed into an output that works with the Linter package.

You need to have phpmd installed on your system, and most likely available on your $PATH.

@XXiao12
Copy link
Author

XXiao12 commented Feb 22, 2017

ohh I see I only installed php and the composer. How would I download phpmd? I tried the command but it did not work. Could I have installed composer wrong?

@Arcanemagus
Copy link
Member

The page I linked to lists several different ways of installing phpmd, I would recommend using Composer (installation).

I'm not sure what command you tried that didn't work, but making sure you have Composer working will probably be your first step.

@XXiao12
Copy link
Author

XXiao12 commented Mar 6, 2017

Yup I followed that website to install composer and I got composer to work but the error on atom still pops up :(

@loureirorg
Copy link

Make sure to have CodeSniffer installed. Instructions for Ubuntu:

sudo apt install phpmd
sudo apt install php-pear
sudo pear install PHP_CodeSniffer

Then, restart Atom.

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

3 participants