Atom packages using wrong paths


#1

I’ve installed packages such as run command, php-debug, phpunit, composer for atom and I’m having a hard time using them due to these packages using old versions of php located in /usr/bin while my newer version is located in /usr/local/bin

This does not happen when i use “Terminal” as my paths env have all be set correctly. I managed to get the run-command2 package to run using a .bashrc but that’s about it.

how do I configure atom to use the default tools on my machine using the correct path env?


#2

Can you fix this with a symlink?


#3

not sure what you mean…can you explain via example?


#4

On linux/mac you can do ln -s /usr/local/bin/php-file /usr/bin/php-file. Then when anything tries to access the file in /usr/bin they will actually be reading the file in usr/local/bin. Windows also has a way to link files.

I’m not saying this is the “right” way to fix this or that it is sure to work. The right way is to post an issue on one of those repos asking what to do. This is just a hack that I myself would try.

Why is the old version there? If you aren’t using it then uninstalling that would be a good start. It might even fix the problem.


#5

Oh symlink…sorry running El Capitan. a lot of permission issues. Wasn’t sure if this was the Apple or something i created so was hesitant to take action


#6

Also,

is the Atom software using the $PATH and are packages just reading off of Atoms settings?

I was looking at the packages separately and there doesn’t seem to be a way of altering where the packages use dependencies from.


#7

There are NPM dependencies that are resolved the normal way. There is a way for one package to depend on another also. But the system stuff is accessed the exact way that any code running in node does. You can study up on node.


#8

OS X has a different PATH when launching applications from the Dock, Spotlight or the Finder than it does when you run an application from the Terminal. This is simply how OS X is designed to work. For a full explanation of the problem, see the Issue here:

This is something that I’m building a fix for here:

Packages will still need to do some extra work on OS X to use this system, it won’t “just happen”. I’m hoping that with the API built-in to Atom that using the API I’m building for things like the PATH will become commonplace though.