-
Notifications
You must be signed in to change notification settings - Fork 119
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
Cannot install fsevents with Electron as runtime #131
Comments
That's a node-pre-gyp issue, not a fsevents issue. Presumably you didn't pass |
@bnoordhuis thanks, specifying runtime seems to work. Is there a way to configure this with an environment variable instead of passing it to npm as argument? |
I'm reasonably sure |
While I can install now, requiring
I don't think in the older chokidar (without node-pre-gyp) did we have such a long path to require the fse.node. It just lives inside |
Give this a try:
|
@es128 is the |
Now I am getting a folder after installation |
No it's not part of the variable, I'm just setting it transiently as I run the command. Not sure on the other part. Perhaps try deleting |
Unfortunatley that returns the "Error: Unsupported target version: 0.37.6" error. |
Looks like I need to bump up the node-pre-gyp dependency. Really annoying how it needs to explicitly keep track of all possible versions |
I updated the branch, give it a try |
@es128 yeah it would be nice if there was a way to tell npm to ignore all of node-pre-gyp if a certain environment variable is set. In my case I am totally fine compiling fsevents each time. Which branch are we talking about for me to try? |
The npm install command I had given you earlier was pulling it from there |
@es128 ok is your change having an impact on where the fse.node ends up? Now I am a bit confused if I should still use the runtime option :) |
node-pre-gyp changes where the binary goes. What I did was wire node-pre-gyp's I tried cutting out the We could maintain and publish a fork I guess, but then we'd need the same for chokidar. Would be nice if |
@es128 ok here are the results: with npm_config_runtime=electron
=> fse.node ends up in without npm_config_runtime=electron it fails to install due to:
Good news is: When I manually rename |
Both conditions seem like bugs in node-pre-gyp tbh. @springmeyer could you take a look please? |
@bpasero you could also potentially pinch your nose and solve this with your own workaround by scripting the rename of the target dir |
Just seeing this. Tied up in a few meetings right now but will digest this and try to help as soon as I can. |
+1 I'm having lots of related issues using apm which just wraps npm: atom/apm#531 Feels like there's a lot of confusion on node version vs electron version. Currently, I cannot use my own package under atom because it uses chokidar -> fsevents. Atom refuses to load it until I can rebuild for electron but I simply cannot figure out how to do it right now. |
This helped me a lot: http://electron.atom.io/docs/tutorial/using-native-node-modules/
|
I've spent hours sorting this out, and it's pretty simple once you get it.
In webpack main process build, you need this to prevent webpack from trying to resolve dependencies in a way that doesn't make sense in an Electron runtime context.
This will not only remove "Critical dependency: the request of a dependency is an expression" warnings you might get so far, but it will also ensure that fsevents is imported with a simple... Of course, fsevents must be natively compiled and embedded in Electron. Hope it helps someone ! |
Using latest
fsevents
that bringsnode-pre-gyp
I am no longer able to install this dependency (viachokidar
) into VS Code that leverages Electron as framework.Our
npm
script for installation configures some environment variables to pick up the correct headers for the embedded node.js version within Electron:npm_config_disturl=https://atom.io/download/atom-shell \ npm_config_target=$ELECTRON_VERSION \
Running this via
npm install
yields:This basically means we cannot update to newer versions of
chokidar
currently.The text was updated successfully, but these errors were encountered: