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

js-beautify not found #6

Open
drewwells opened this issue Jun 9, 2014 · 10 comments
Open

js-beautify not found #6

drewwells opened this issue Jun 9, 2014 · 10 comments

Comments

@drewwells
Copy link

Even after installing js-beautify globally, I'm getting errors running this in EMACS. This may be because I use NPM. Can you add some notes about setting up the paths correctly in EMACS, so that this package can find js-beautify?

@dentrinh
Copy link

What is the issue exactly?

@tacit7
Copy link

tacit7 commented Aug 9, 2014

I think Im having the issue that drewwells was having. I downloaded js-beautify using the -g option, but emacs is having problems calling js-beautify. I get 'js-beautify not found' when I call web-beautify-js.

@dentrinh
Copy link

@tacit7 @drewwells Are you both still experiencing the issue? Have you verified that js-beautify is part of your PATH for Emacs? Could you provide some more information if you are still having issues, e.g. operating system, emacs version, error traces, etc.

@tacit7
Copy link

tacit7 commented Sep 11, 2014

@dentrinh I solved the issue, but I don't quite remember what I did to solve it. But I think I had to add the path to js-beautify to my emacs config.

Im an emacs newb, so I didnt know I had to do that.

@drewwells
Copy link
Author

I added js-beautify to my path as well.

On Thu, Sep 11, 2014 at 10:12 AM, uriel notifications@github.com wrote:

@dentrinh I solved the issue, but I don't quite remember what I did to solve it. But I think I had to add the path to js-beautify to my emacs config.

Im an emacs newb, so I didnt know I had to do that.

Reply to this email directly or view it on GitHub:
#6 (comment)

@gihankarunarathne
Copy link

I got the same problem and I'm using Ubuntu 14.04 and node customize version v0.10.30 (which is downloaded and install in /opt/node/bin, then added it to PATH variable ).

I solved the problem using following steps;

  1. cd ~/.emacs.d/vendor
  2. git clone https://github.com/yasuyk/web-beautify.git
  3. cd web-beautify.git
  4. npm install js-beautify
  5. mv node_modules/.bin node_modules/bin
  6. Edit each file in node_modules/bin (such as css-beautify etc..)
    change "#!/usr/bin/env node" into "#!/opt/node/bin/node"

Note: if you added as "#!/opt/node/bin", it will give permission error.
7. Added "(setq exec-path (append exec-path '("~/.emacs.d/vendor/web-beautify/node_modules/bin")))" into your emacs config file (.emcs or init.el)
8. Setup web-beautify : https://github.com/yasuyk/web-beautify#manual

Cheers ... !!!

@lvguowei
Copy link

lvguowei commented Dec 8, 2014

This happened to me on mac.

Solved it by doing the following:

  • Finds out the js-beautify executable on your machine by which js-beautify.
  • add this dir into the Exec Path in emacs in customize page.

@anthonyteo
Copy link

Hi all,

The same problem happened to me on my Mac. I am able to get the result of which js-beautify, which is /usr/local/bin/js-beautify, but I have no idea how to "add this dir into the Exec Path in emacs in customize page" as mentioned by @lvguowei. I know I have installed js-beautify on my system because I was able to run js-beautify -h as well, and I know Emacs understands M-x web-beautify-js too. The only problem is the said error when I run M-x web-beautify-js on Emacs...

Can someone please provide me detailed instructions as to how exactly I should add js-beautify to my path so that my Emacs understands it? Many thanks in advance.

@dentrinh
Copy link

@anthonyteo Assuming that the path to js-beautify is missing when you do "M-x getenv PATH", you can append the path to the exec path in your init file: http://emacswiki.org/emacs/ExecPath. Alternatively you can grab this: https://github.com/purcell/exec-path-from-shell.

@anthonyteo
Copy link

@dentrinh Thank you so much. Now it works. :)

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

No branches or pull requests

6 participants