Skip to content
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

beautysh not found after restart of Atom #1639

Closed
5 tasks done
Mazorius opened this issue May 3, 2017 · 4 comments
Closed
5 tasks done

beautysh not found after restart of Atom #1639

Mazorius opened this issue May 3, 2017 · 4 comments
Assignees

Comments

@Mazorius
Copy link

Mazorius commented May 3, 2017

Description

I install Atom Beautifier and run the following command inside Terminal

pip install beautysh

In Terminal which can find it under /usr/local/bin/.
And it works fine.

I got the following error after restart Atom:

Could not find 'beautysh'. The program may not be installed.

See https://github.com/bemeurer/beautysh for program installation instructions.
Your program is properly installed if running 'which beautysh' in your Terminal returns an absolute path to the executable. If this does not work then you have not installed the program correctly and so Atom Beautify will not find the program. Atom Beautify requires that the program be found in your PATH environment variable. 
Note that this is not an Atom Beautify issue if beautification does not work and the above command also does not work: this is expected behaviour, since you have not properly installed your program. Please properly setup the program and search through existing Atom Beautify issues before creating a new issue. See https://github.com/Glavin001/atom-beautify/search?q=beautysh&type=Issues for related Issues and https://github.com/Glavin001/atom-beautify/tree/master/docs for documentation. If you are still unable to resolve this issue on your own then please create a new issue and ask for help.

Stacktrace:
Error: Could not find 'beautysh'. The program may not be installed.
    at BashBeautify.module.exports.Beautifier.commandNotFoundError (/Users/rog/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:231:14)
    at /Users/rog/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:331:22
    at tryCatcher (/Users/rog/.atom/packages/atom-beautify/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/rog/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/Users/rog/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/Users/rog/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/Users/rog/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:689:18)
    at Async._drainQueue (/Users/rog/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/Users/rog/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:143:10)
    at Async.drainQueues (/Users/rog/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:17:14)
    at process._tickCallback (internal/process/next_tick.js:103:7)

Steps to Reproduce

  1. Install Atom Beautifier.
  2. Install beautysh via Terminal.
  3. It should work.
  4. Restart Atom
  5. It does not work.

Debug

https://gist.github.com/Mazorius/43b9f02ec9f8dfbeddf4005d2cf5bbfd#file-debug-md

Checklist

I have:

  • Tried uninstalling and reinstalling Atom Beautify to ensure it installed properly
  • Reloaded (or restarted) Atom to ensure it is not a caching issue
  • Searched through existing Atom Beautify Issues at https://github.com/Glavin001/atom-beautify/issues
    so I know this is not a duplicate issue
  • Filled out the Input, Expected, and Actual sections above or have edited/removed them in a way that fully describes the issue.
  • Generated debugging information by executing Atom Beautify: Help Debug Editor command in Atom and added link for debug.md Gist to this issue
@Glavin001 Glavin001 self-assigned this May 28, 2017
@Glavin001
Copy link
Owner

Looking at your logs, something went wrong 😛 :

2017-05-03T11:01:33.516Z - debug: [beautifiers/beautifier.coffee] exePath, env: beautysh
2017-05-03T11:01:33.516Z - debug: [beautifiers/beautifier.coffee] args 0=-i, 1=4, 2=-f, 3=/var/folders/_j/1w58dv_s52vdfrnpt1bhf79r0000gn/T/input11743-43429-v7kh2v.7wlbzw7b9
2017-05-03T11:01:33.516Z - debug: [beautifiers/beautifier.coffee] spawn beautysh 0=-i, 1=4, 2=-f, 3=/var/folders/_j/1w58dv_s52vdfrnpt1bhf79r0000gn/T/input11743-43429-v7kh2v.7wlbzw7b9
2017-05-03T11:01:33.522Z - debug: [beautifiers/beautifier.coffee] error Error: spawn beautysh ENOENT

When exePath, env: is printed I expect to see two variables following: 1) execPath and 2) env:

@debug('exePath, env:', exePath, env)

I only see execPath value. It looks like the env -- your environment variables -- are missing!

This could be why beautifysh is not found. The environment variables, specifically PATH, is used to determine paths to your executable files, such as beautysh.

Are you using a custom shell? This line could be a culprit:

child = spawn process.env.SHELL, ['-ilc', 'env'],

I've heard some users experiencing problems while using different shells: #1113

@Glavin001
Copy link
Owner

I really want to focus on improving the installation experience for users. I have created a new Issue, #1687, to target this problem. Please provide your feedback! Thanks in advance.

@Glavin001
Copy link
Owner

#1687 has been published to v0.30.0. You should now be able to configure the executable/script path in Atom-Beautify package settings:
image

@Mazorius
Copy link
Author

Thank you very much for your help.
Sorry that I answer such late but I do not get notifications about your answer.
I will try the new version to test if it goes then.

To answer your questions.
I work with terminal daily and use the fish shell.
So I checked if beautysh works inside the shell.
I also trieb the bash shell and there beautysh as a command was also found.

So my conclusion was that Atom did not use my original PATH variable.

I will give you feedback after testing the new version.

Additions:
which beautysh
prints in bash the following: /usr/local/bin/beautysh
prints in fish shell the following: /usr/local/bin/beautysh

Thank you again!!
I will comment my feedback soon. :)

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

No branches or pull requests

2 participants