Medium/phantomjs — pull request #184 by nathanjsweet (2014-06-07 02:08:25+00:00)
Title: Fixing install.js when npm link is called.

Currently npm link calls install.js but provides it with a bad path as several files that being with "phantomjs" exit in the npm root folder (for global calls). Therfore, "which" incorrectly resolves the path, giving a mistaken path to the promise. A simple check to make sure that the path isn't resolving "phantomjs" immediately after "npm" clears up the issue nicely (i.e. the path does not contain the substring "npm/phantomjs", as the correct file will always exit within node_modules of the npm folder. If the culprit substring isn't present the file writes, if it is, it doesn't.