{"action":"created","issue":{"url":"https://api.github.com/repos/websockets/ws/issues/577","labels_url":"https://api.github.com/repos/websockets/ws/issues/577/labels{/name}","comments_url":"https://api.github.com/repos/websockets/ws/issues/577/comments","events_url":"https://api.github.com/repos/websockets/ws/issues/577/events","html_url":"https://github.com/websockets/ws/issues/577","id":105480136,"number":577,"title":"Eliminate native dependencies","user":{"login":"feross","id":121766,"avatar_url":"https://avatars.githubusercontent.com/u/121766?v=3","gravatar_id":"","url":"https://api.github.com/users/feross","html_url":"https://github.com/feross","followers_url":"https://api.github.com/users/feross/followers","following_url":"https://api.github.com/users/feross/following{/other_user}","gists_url":"https://api.github.com/users/feross/gists{/gist_id}","starred_url":"https://api.github.com/users/feross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feross/subscriptions","organizations_url":"https://api.github.com/users/feross/orgs","repos_url":"https://api.github.com/users/feross/repos","events_url":"https://api.github.com/users/feross/events{/privacy}","received_events_url":"https://api.github.com/users/feross/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-08T22:14:27Z","updated_at":"2015-09-09T00:11:37Z","closed_at":null,"body":"Because of the `bufferutil` and `utf-8-validate` dependencies in `ws`, many users see cryptic errors when installing `ws` or anything that depends on it.\r\n\r\nHere's an example: \"I can't build torrent-stream on my machine. It complains about MSB3428 (visual c++) when triggering node-gyp.\"\r\n\r\nHere's another example, from my machine:\r\n\r\n```\r\n> bufferutil@1.1.0 install /usr/local/lib/node_modules/webtorrent/node_modules/torrent-discovery/node_modules/bittorrent-tracker/node_modules/ws/node_modules/bufferutil\r\n> node-gyp rebuild\r\n\r\nxcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance\r\n\r\nxcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance\r\n\r\n  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o\r\n  SOLINK_MODULE(target) Release/bufferutil.node\r\n\r\n> utf-8-validate@1.1.0 install /usr/local/lib/node_modules/webtorrent/node_modules/torrent-discovery/node_modules/bittorrent-tracker/node_modules/ws/node_modules/utf-8-validate\r\n> node-gyp rebuild\r\n\r\nxcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance\r\n\r\nxcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance\r\n\r\n  CXX(target) Release/obj.target/validation/src/validation.o\r\n  SOLINK_MODULE(target) Release/validation.node\r\n```\r\n\r\nKeep in mind for that last example of error spew, I actually have the OS X command line tools installed. Apparently, a compiler toolchain is still not enough. You actually need to install an IDE – Xcode. This is unreasonable.\r\n\r\nIt's true that these are optional dependencies... but npm's UX is really bad here. Error messages are displayed to the end user so they usually think something went wrong during installation. I keep getting asked about this.\r\n\r\nThe optional deps make it really hard to depend on `ws` in command line tools that normal users (i.e. not module authors) will be installing.\r\n\r\nCan we discuss how we might eliminate these native dependencies?\r\n\r\ncc @maxogden @mafintosh"},"comment":{"url":"https://api.github.com/repos/websockets/ws/issues/comments/138736321","html_url":"https://github.com/websockets/ws/issues/577#issuecomment-138736321","issue_url":"https://api.github.com/repos/websockets/ws/issues/577","id":138736321,"user":{"login":"maxogden","id":39759,"avatar_url":"https://avatars.githubusercontent.com/u/39759?v=3","gravatar_id":"","url":"https://api.github.com/users/maxogden","html_url":"https://github.com/maxogden","followers_url":"https://api.github.com/users/maxogden/followers","following_url":"https://api.github.com/users/maxogden/following{/other_user}","gists_url":"https://api.github.com/users/maxogden/gists{/gist_id}","starred_url":"https://api.github.com/users/maxogden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxogden/subscriptions","organizations_url":"https://api.github.com/users/maxogden/orgs","repos_url":"https://api.github.com/users/maxogden/repos","events_url":"https://api.github.com/users/maxogden/events{/privacy}","received_events_url":"https://api.github.com/users/maxogden/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T00:11:37Z","updated_at":"2015-09-09T00:11:37Z","body":"Since both of those cases are currently optional, why not ship it without\nthose and have instructions to install them separately? In my opinion\ngetting of the confusing ux of optionalDependencies is more important (and\neasier to fix here than in npm).\n\nOn Tuesday, September 8, 2015, Arnout Kazemier <notifications@github.com>\nwrote:\n\n> @maxogden <https://github.com/maxogden> The 2 binary addons are there for\n> 2 different reasons:\n>\n>    1. the buffer utils includes performance enhancement for buffer\n>    operations and websocket masking.\n>    2. the rfc specification requires UTF8 validation of messages to\n>    ensure that nothing bad or broken can be send over the connection, this\n>    utf-8 validation could not be done in JavaScript and needed to be written\n>    as binary addon. If this is removed the module will no longer be RFC\n>    compliant.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/websockets/ws/issues/577#issuecomment-138732813>.\n>\n\n\n-- \nSent from my phone\n"}}