-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Add fsevents to NodeJS #7858
Comments
/cc @saghul, perhaps? |
For context, fsevents is primarily used for non poll based file watching on OSX, as it is not supported by default. It is maintained by strongloop and has an MIT license. I have been individually interested in improving the Node.js file watching story for a minute, and would be interested in exploring this if we decide it is something that we want to include in the platform. as I think @ChALkeR is hinting at this would most likely be implemented in libuv and in turn floated up to node (potentially without any change to Node interfaces). @saghul can you give us a bit of an insight into the current OSX filewatching story in libuv and why the hooks into Core Services are not currently implemented? |
Libuv uses FSEvents (the platform API, not the npm module) internally but it (and therefore node) presents a largest common denominator API, meaning it provides the most consistent cross-platform API that is possible with something as platform-specific as file watching. In short, libuv works this way for a reason and won't change. If you want something more full-featured, use the relevant npm module. |
Ben said it all :-) We do however, have some features that are supported on some backends but not in others: recursive file watching, for instance. As for the warning: IMHO there should be no warning printed if an optional dependency doesn't apply to the current OS, but that's an npm thing. |
But what about the development workflow issue? If so many fundamental tools require the use of fsevents, must we mandate that all teams npm install from mac's so that dependencies are set up correctly as the angular team has had to do? I think there is a hole there. "Node thing/npm thing" I don't think captures the spirit of node development. Node would not be very important without npm and much of node's ubiquity is due to the web tool chain based on node. So I think there are several developer user stories that merit looking at supporting something beyond a "least common denominator" implementation. |
My reply was to the warning part. As for the workflow part, given that fsevents is already a dependency of the projects which use it and it's installed on the appropriate OS when needed without user interaction (other than Or maybe I misunderstood your point. Maybe you can rephrase / elaborate? As in, what is the problem with having those optional dependencies? |
The workflow issue is for the developers of a development tool, not it's users. The instructions given by the Angular team is necessary for any development package that supports a watch function. From my suggestion above:
It seems rather silly that if you are using Windows or Linux, you would need to ask a MacOS user to |
fsevents (the module) ships pre-compiled binaries by means of node-pre-gyp. It's possible to do the packaging on non-OS X but you may have to jump through a few hoops to pacify |
OK. So the issue could be solved by changing the fsevents package, itself, right? Seems reasonable. Anywhere you can point me how "pacify |
I'd say that's more of an npm question. In the past I've used preshrinkwrap scripts for downloading binaries and that worked quite well but better solutions may exist. |
For this reason |
What is the solution for Windows-users? |
My OS is Windows 10. I tried to install chokidar via "npm install chokidar", but get some warnings:
|
Yeah, uh, that's what this thread is all about. The warning should probably be an info. Ignore the error it's supposed to work that way. The optional dependency is needed only on OSX systems to get decent performance. It's not needed on Windows or Linux, so no need to worry. It's just something that we all have to learn. |
Warnings and errors that much are'nt familiar to me. Mostly I've been working in the Microsoft / Windows / Database / Desktop world in the last 20 years. Most of the development tools in this world are elaborated and stable because of their longevity. But the Google / Angular / Firebase world is much more fascinating and seems to be the technology leader in the near future. Let's go on trying and learning :-) |
Yeah, I call it Google Driven Development (GDD) — and I'm speaking of the search engine, not the stack. You will soon become a Full StackOverflow Developer. Finally you will develop JavaScript Fatigue, and want to chuck it. But you, as a professional devloper with mouths to feed, will soldier on and finally develop JavaScript-Fatigue fatigue, decide to know what you know, and get the job done. It's the next generation's crazy world. I'm just trying to feed my family in it. |
Yeah. That's the other side: Develop yourself and your skills by moving to Google. I moved from Microsoft to Google because Microsoft is always saying "you can't do this, you can't do that because of security, security, security." And if you find a way to do what you want, you will be stopped 5 months later by security updates. With angular it's like running against the wall several times, then breaking it. After that you find yourself in a labyrinth of packages and modules that is changing every day. It's fascinating. |
Hi getting error while installing npm C:\Users\DivyaP>npm install fsevents npm ERR! notsup Not compatible with your operating system or architecture: fsevents@1.0.14 npm ERR! Please include the following file with any support request: Please advice. |
fsevents is only compatible with OSX. It's specific to that platform, so it On Sep 19, 2016 08:04, "DivyaPoornam91" notifications@github.com wrote:
|
Every time I am told "Ignore this warning" a get a bad feeling in my stomach. Fact is, architecture dependent dependencies should either be ignored or throw an ERROR on unsupported architectures. Java/Maven has had this for 9 years....npm should have it too. |
@clavecoder Is there a reason this issue was closed? I can ignore the warning but being spammed with it every time I run npm means I'll tend to miss / ignore legitimate warnings. |
@proehlen There is nothing Node can fix here AFAIK. It's npm which should fail more gracefully if the user tries to install a package in an unsupported platform, I guess. |
Suggestion
Add a normalized native interface for fsevents and chokidar so that optional dependencies can be avoided on development oriented packages and to improve development package workflow.
Details
Non non-IOS platforms, many development packages installed through
npm
result in the warning:The instructions for contributing to the popular Angular 2 project states:
It seems to be a rather dubious workflow that's made necessary by the lack of an efficient native file watch capability in node. If NodeJs supplied a normalized fast directory watcher directly, there would be no need for these gymnastics.
Prior Art
The text was updated successfully, but these errors were encountered: