{"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":12,"created_at":"2015-09-08T22:14:27Z","updated_at":"2015-09-09T19:38:21Z","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/139024147","html_url":"https://github.com/websockets/ws/issues/577#issuecomment-139024147","issue_url":"https://api.github.com/repos/websockets/ws/issues/577","id":139024147,"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-09T19:38:21Z","updated_at":"2015-09-09T19:38:21Z","body":"There are also various options ready to go today to handle prebuilt binaries that popular native addons like leveldown, sqlite3 use: https://www.npmjs.com/package/node-pre-gyp https://www.npmjs.com/package/prebuild\r\n\r\nI think using either of the above modules would also help address this issue, but not solve it. I don't think waiting on npm is a good strategy when it can be fixed now.\r\n\r\nI would personally like a way to use `ws` that never tries to compile anything."}}