Code Monkey home page Code Monkey logo

Comments (6)

LionyxML avatar LionyxML commented on May 21, 2024 3

I found the solution to this problem by installing this beauty from MELPA: https://github.com/purcell/exec-path-from-shell

After install, justa add this anywhere in your .emacs file:
(exec-path-from-shell-initialize)

And that's it. Now your shell path is available to GUI MacOS fired from from Desktop Applications, allowing you to run prettier, node, etc.

from prettier-emacs.

petsgre avatar petsgre commented on May 21, 2024

i get same error

from prettier-emacs.

itzikBraun avatar itzikBraun commented on May 21, 2024

I found this issue in NVM repository. I tried sudo env node in the terminal and had the same error as I got in emacs, i.e env: node: No such file or directory.

I am not sure why emacs has the same behavior as running sudo, but it only happens when I start emacs from desktop. If I run emacs from command line (with or without GUI), prettierjs works as expected.

I hope it helps even if it doesn't solve the problem completely. Maybe a more in depth reading of that thread will lead you to the answer, I am satisfied with running it from command line.

from prettier-emacs.

LionyxML avatar LionyxML commented on May 21, 2024

I do have this problems with MacOS also.

It seems to be a broader issue then just prettier.

When I start Emacs from Applications or Spotlight, env outputs different then when loading from the terminal.

You can output your env in shell and then output the env from e-shell inside emacs. If they are different you have this "broader" problem.

When launching from command line, repeat this experiment and you'll see both will be the same values.

This guy here made a "fix" for MacOS. If you're not in MacOS, I am sure something can be done with xdg or the default X launcher:
https://gist.github.com/d12frosted/18ed4b3b5d5267428a0da16da6d016b4

from prettier-emacs.

LionyxML avatar LionyxML commented on May 21, 2024

Also this did not fixed for me.

I usually run:
$ Open /Application/Emacs.app

from prettier-emacs.

ishambhandari avatar ishambhandari commented on May 21, 2024

Try copying your ~/.bashrc to ~/.bash_profile. And source ~/.bash_profile.

from prettier-emacs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.