-
Notifications
You must be signed in to change notification settings - Fork 0
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
Atom (Electron?) sets bogus execPath
#1
Comments
Oh, hi! 👋
Why wouldn't we want to fix it? If there's something we can do to make it usable in Electron apps, I think it's best to at least consider the fix. I'm not very familiar with Electron myself. Do you know if there is a standard way to detect if we run inside Electron? And also, how could we get correct npm prefix for Electron? Lastly, I think it's probably a good idea to check for such cases in the future so that |
You’re right. Let’s!
So, my use case is load-plugin, which is used in remark’s CLI, to load for this behaviour is enabled by default when an executable is installed globally, in this case, or if in Electron, by checking
No idea. I do know that nvm (which I use) adds a location which we can use in
Maybe the substring |
What I had in mind was the last component of the path. It seems that Node.js executable is usually named
Is
I'm not sure about this. Part of the job of this module is to find npm prefix for Node.js instance it is running in, not just any Node.js on the system. Wouldn't you get a prefix for Node.js managed by |
@eush77 I forgot about this issue, sorry!
I don’t think we can fix this issue in this module. Atom explicitly sets one, so it would be weird if this module (being made for finding that local one) would return another. Maybe we should create a new package, |
Yeah, I think this issue is not this module's fault, nor Electron's fault. The behavior is kind of expected actually. I mean, this module assumes that
The question then is, how do we define what's its job? Users may have different Node instances installed in different locations (I surely have). A particular instance can be controlled by For AtomLinter/linter-markdown#115, the problem is then to find a piece of an environment info that would point to the location of Remark plugins. We could use So, in a nutshell, I think the problem should be formulated in a more precise terms before we can take a shot at it. |
Previously, Electron was supported for global modules, but only if a `prefix` is set (e.g., in `.npmrc`). If you’re using nvm, there’s no need to set-up a `prefix`, and luckily nvm exposes environment things to let Electron pick up on those modules. Closes eush77/npm-prefix#1. Closes AtomLinter/linter-markdown#115. Closes remarkjs/remark-lint#147.
Took an incredible while, but I found the fix, or, mostly:
Cheers! 👋 |
Hi! 👋
Working on AtomLinter/linter-markdown#115, I found that Atom is setting an
execPath
to something without the normal npm stuff. Maybe Electron is the culprit. In my case:'/Applications/Atom.app/Contents/Frameworks/Atom Helper.app/Contents/MacOS/Atom Helper'
, when popping the last two path-parts, we get something without the npm stuff:I’m not sure if we can work around this, or want to fix it. I’d like to hear your thoughts on this though!
Cheers!
The text was updated successfully, but these errors were encountered: