Open XXiao12 opened 7 years ago
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
.
I am using a mac so would I type it in my terminal? I got:
usage: which [-as] program ...
as the output
I also tried npm install atom-linter@~4.6.1 from another thread: └─┬ atom-linter@4.6.1 invalid └── sb-promisify@1.3.0
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
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:
(The same goes for linter-phpcs
)
It says:
Error: Failed to spawn command phpmd. Make sure phpmd is installed and on your PATH
Okay, that's progress at least.
What do you get when you run which phpmd
?
It returns nothing
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)
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?
yes I installed it, I forgot to include phpmd in the first sentence. Linter-phpmd is phpmd right?
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
.
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?
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.
Yup I followed that website to install composer and I got composer to work but the error on atom still pops up :(
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.
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?
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