If I already have pathwatcher, why does it need to be recompiled?


I ran into some trouble installing the pdf-view package from @izuzak last night on Windows 8.1. It looks like one of the dependencies, pathwatcher, has some native code and requires compilation. node-gyp was failing since I didn’t have a compiler installed. Once I installed Visual Studio 2013 Express, both pathwatcher and pdf-view installed with no issue.

It appears that the markdown-preview (can’t add more links since I’m a new user!) package also uses pathwatcher. Yet, it shipped with my Atom binary and required no compilation on my part. Can packages use the pathwatcher that comes with Atom versus requiring the user to install a hefty package of developer tools to compile it?


This is a question most likely for @kevinsawicki since he recently redid the module sharing code for Atom.


Packages do reuse dependencies whenever possible.

But apm still installs all the dependencies even when they might not be used, this is to guard against the case of a dependency from another package going away eventually.

So lets say you went to install pdf-view and it didn’t install pathwatcher since markdown-preview provides it. Then on the next Atom update, markdown preview switches to a different library for pathwatching. Now pdf-view would break since pathwatcher would be no longer available.