Comments (6)
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.
i get same error
from prettier-emacs.
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.
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.
Also this did not fixed for me.
I usually run:
$ Open /Application/Emacs.app
from prettier-emacs.
Try copying your ~/.bashrc to ~/.bash_profile. And source ~/.bash_profile.
from prettier-emacs.
Related Issues (20)
- How validate and format json HOT 1
- "No such file or directory" "prettier" Error HOT 1
- Using eslint_d to do the same as this package
- [question] "prettier-js is an available obsolete package."
- Disable formatting on save HOT 3
- prettier empties file HOT 1
- Could not apply prettier HOT 1
- diff error on OpenBSD
- prettier-js-mode reformats file even when file is in .prettierignore HOT 3
- Highlighting "flickering" while applying formatting HOT 2
- Searching for program: No such file or directory, prettier HOT 2
- [warn] Ignored unknown option --stdin HOT 1
- Convenient way to disable per file HOT 1
- No files matching the pattern were found: "false". HOT 2
- Cannot find prettier anywhere HOT 2
- Prettier not formatting typescript file HOT 1
- do not respect .prettierignore
- Not working with prettier 3.0.1 HOT 2
- Handle cloned buffers and give error message when not visiting a file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prettier-emacs.