{"action":"created","issue":{"url":"https://api.github.com/repos/mongodb/js-bson/issues/118","labels_url":"https://api.github.com/repos/mongodb/js-bson/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/mongodb/js-bson/issues/118/comments","events_url":"https://api.github.com/repos/mongodb/js-bson/issues/118/events","html_url":"https://github.com/mongodb/js-bson/issues/118","id":63593323,"number":118,"title":"Gyp build fails without a warning.","user":{"login":"IvanGoncharov","id":8336157,"avatar_url":"https://avatars.githubusercontent.com/u/8336157?v=3","gravatar_id":"","url":"https://api.github.com/users/IvanGoncharov","html_url":"https://github.com/IvanGoncharov","followers_url":"https://api.github.com/users/IvanGoncharov/followers","following_url":"https://api.github.com/users/IvanGoncharov/following{/other_user}","gists_url":"https://api.github.com/users/IvanGoncharov/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanGoncharov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanGoncharov/subscriptions","organizations_url":"https://api.github.com/users/IvanGoncharov/orgs","repos_url":"https://api.github.com/users/IvanGoncharov/repos","events_url":"https://api.github.com/users/IvanGoncharov/events{/privacy}","received_events_url":"https://api.github.com/users/IvanGoncharov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-23T00:27:15Z","updated_at":"2015-03-25T16:53:51Z","closed_at":null,"body":"I spend couple hours figuring out why I have following warning:\r\n>Failed to load c++ bson extension, using pure JS version\r\n\r\nIt's actually a very [common](https://www.google.com.ua/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=js-bson%3a%20failed%20to%20load%20c%2b%2b%20bson%20extension%2c%20using%20pure%20js%20version) issue, but each case have different root cause(in my case it was missing \"node-legacy\" package).\r\n\r\nI think real problem is that \"npm install\" doesn't provide any warnings or other clues.\r\nThe following line from package.json is responsible for that:\r\n>\"install\" : \"(node-gyp rebuild 2> builderror.log) || (exit 0)\",\r\n\r\nNPM is [explicitly discourage](https://docs.npmjs.com/misc/scripts#note-install-scripts-are-an-antipattern) such tricks. But I understand why fallback mechanism is needed.\r\n\r\nSolution would be to extract C++ part into separate NPM package and connect it using [optionalDependencies](https://docs.npmjs.com/files/package.json#optionaldependencies) feature.\r\n"},"comment":{"url":"https://api.github.com/repos/mongodb/js-bson/issues/comments/86120076","html_url":"https://github.com/mongodb/js-bson/issues/118#issuecomment-86120076","issue_url":"https://api.github.com/repos/mongodb/js-bson/issues/118","id":86120076,"user":{"login":"RomanGotsiy","id":3975738,"avatar_url":"https://avatars.githubusercontent.com/u/3975738?v=3","gravatar_id":"","url":"https://api.github.com/users/RomanGotsiy","html_url":"https://github.com/RomanGotsiy","followers_url":"https://api.github.com/users/RomanGotsiy/followers","following_url":"https://api.github.com/users/RomanGotsiy/following{/other_user}","gists_url":"https://api.github.com/users/RomanGotsiy/gists{/gist_id}","starred_url":"https://api.github.com/users/RomanGotsiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RomanGotsiy/subscriptions","organizations_url":"https://api.github.com/users/RomanGotsiy/orgs","repos_url":"https://api.github.com/users/RomanGotsiy/repos","events_url":"https://api.github.com/users/RomanGotsiy/events{/privacy}","received_events_url":"https://api.github.com/users/RomanGotsiy/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T16:53:51Z","updated_at":"2015-03-25T16:53:51Z","body":"I had the same warning caused by failed c++ build. NPM silence seems weird in this situation. It would be much better if at least some warning been shown.\r\nBut solution proposed by @IvanGoncharov seems very reasonable."}}