-
Notifications
You must be signed in to change notification settings - Fork 178
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
$PATH is not available on OSX when not launched from CLI #726
Comments
/cc @zcbenz (of Electron) |
Resuming from #150 and AtomLinter/linter-jshint#120 |
Can someone try this and see if it works? https://github.com/sindresorhus/fix-path |
@steeelbrain We may need to use |
@iam4x how does the buffered process solve this? does it support stdin? |
I just tried installing fix-path but I don't know how to actually use it, or whether simply installing it is sufficient. After running 'npm install --save fix-path' and reinstalling linter-jshint I still get the error. |
@adarhef You will not just have to save it there, but will also have to modify the activate function to invoke it like
|
After adding it the result of 'console.log(process.env.PATH)' on my setup is '/usr/bin:/bin:/usr/sbin:/sbin' Is that what you'd expect? I'm still getting the error. EDIT: The result before calling fix-path is the same as after activating it. |
Ahh :( so we will have to try something else then |
This is not a problem of Atom or any other app, but how Mac OS X handles environment variables for CLI and GUI applications. In order to update the environment variables for GUI applications without launching them from the shell to inherit the parents environment, you have to explicitly set them using E.g., to make your shells $ launchctl setenv PATH "$PATH" A quick Googling should provide you with enough information how to do that on each login. PS: Just to clarify, this is not a bug of Atom or any other GUI application and you shouldn't use packages like Altering and constructing a PATH from some source like the shell is a big NONO. PPS: In this superuser question I outlined my current solution for Mac OS X 10.10.4 how to populate my shell environment variables, e.g., PATH, to use in my GUI applications. |
I got here from an AtomLinter/linter-jshint issue about Atom's console showing:
on opening any JS file. In other words, linting JS files using the "bundled" JS linter fails. Facts: Atom 1.0.4, linter-jslint is 1.04, linter is 1.2.3. I open Atom from the CLI on OS X 10.10.4. |
Try use Atom from CLI it work for me. |
Alas, run from my command line, Atom's linter-jshint fails. I erred above: my Atom is 1.02. So except for OS X, we seem to have the same software. And I use the "bundled" jshint -- that is, I do not have an external JS linter so have not set a path to one. I think that is ok. |
@rldona your workaround works for me! thank you! |
@rldona Thank you for that work around. |
Same as @psko for me too... |
Same error on windows 7. Uncaught Error: write EOF |
JSHint people see AtomLinter/linter-jshint#145 (comment) |
Latest update fixed the issue for me on OSX. Thanks! |
Same as @psko for me on Windows 7 (plugin version 1.1.2) |
Getting the same bug as @psko on Windows 7 as well. Proper environment variables have been set and even then it is the same bug. Tried manually changing the executable path setting in the linter-jshint config. |
For jshint users, I had to make a change that passes ENV from atom the the spawned linters, It fixed AtomLinter/linter-jshint#140 but introduced AtomLinter/linter-jshint#145
|
Just want to add, Atom pointed me to this issue here with the dialogs shown by all the other people. Anyway, I had wrong formating in my .jshintrc file. Fixing the syntax, removed the error. So first check if you are using a .jshintrc configuration and it hasn't any syntax errors. |
Confirming that downgrading to |
Like @renestalder i had an error in my .jshintrc file. |
A stray comma in |
@Aendrew Making sure my .jshintrc is valid (without trailing commas) fixed it for me. |
Here's an announcement for you, we have recently published a release of |
Sweet. 👍 |
Thanks 👍 |
Working on publishing updates to plugins that include this now 😉. |
Woooot! 🍭 |
Latest version here, using El Capitan and ZSH. Having this issue with a few linters. Adding the following to my init seems to the trick. exec = require('child_process').exec
exec('source ~/.zshrc')
childProcess = require('child_process')
process.env.PATH = childProcess.execFileSync(process.env.SHELL, ['-i', '-c', 'echo $PATH']).toString().trim() |
@devkinetic Any linter using |
Similar problem here: |
Ideas people?
I had thought of parsing
~/.bashrc
or similar of users to extract the values ourselves but that doesn't seem like the best solution.The text was updated successfully, but these errors were encountered: