{"action":"closed","issue":{"url":"https://api.github.com/repos/alexanderGugel/ied/issues/100","repository_url":"https://api.github.com/repos/alexanderGugel/ied","labels_url":"https://api.github.com/repos/alexanderGugel/ied/issues/100/labels{/name}","comments_url":"https://api.github.com/repos/alexanderGugel/ied/issues/100/comments","events_url":"https://api.github.com/repos/alexanderGugel/ied/issues/100/events","html_url":"https://github.com/alexanderGugel/ied/issues/100","id":144392997,"number":100,"title":"lifecycle scripts race condition","user":{"login":"kirbysayshi","id":90831,"avatar_url":"https://avatars.githubusercontent.com/u/90831?v=3","gravatar_id":"","url":"https://api.github.com/users/kirbysayshi","html_url":"https://github.com/kirbysayshi","followers_url":"https://api.github.com/users/kirbysayshi/followers","following_url":"https://api.github.com/users/kirbysayshi/following{/other_user}","gists_url":"https://api.github.com/users/kirbysayshi/gists{/gist_id}","starred_url":"https://api.github.com/users/kirbysayshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirbysayshi/subscriptions","organizations_url":"https://api.github.com/users/kirbysayshi/orgs","repos_url":"https://api.github.com/users/kirbysayshi/repos","events_url":"https://api.github.com/users/kirbysayshi/events{/privacy}","received_events_url":"https://api.github.com/users/kirbysayshi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-29T21:26:21Z","updated_at":"2016-05-27T01:29:59Z","closed_at":"2016-05-27T01:29:59Z","body":"Using the real-world (ish) package.json found here: https://gist.github.com/kirbysayshi/8b32f5ae77898475f0ee172e0452d713, ied fails to install with the following error:\r\n\r\n```sh\r\n$ ied install\r\nmodule.js:338\r\n    throw err;\r\n          ^\r\nError: Cannot find module 'hawk'\r\n    at Function.Module._resolveFilename (module.js:336:15)\r\n    at Function.Module._load (module.js:278:25)\r\n    at Module.require (module.js:365:17)\r\n    at require (module.js:384:17)\r\n    at Object.<anonymous> (/private/tmp/ied-test/node_modules/756151e61e615e807a3e1ae03f2340a325ed3501/request.js:10:12)\r\n    at Module._compile (module.js:460:26)\r\n    at Object.Module._extensions..js (module.js:478:10)\r\n    at Module.load (module.js:355:32)\r\n    at Function.Module._load (module.js:310:12)\r\n    at Module.require (module.js:365:17)\r\n/Users/drewp/nvm/versions/node/v0.12.7/lib/node_modules/ied/bin/cmd.js:57\r\n          throw err\r\n                ^\r\nError: Command node install.js ended with code 1\r\n    at ChildProcess.<anonymous> (/Users/drewp/nvm/versions/node/v0.12.7/lib/node_modules/ied/lib/run.js:19:68)\r\n    at ChildProcess.emit (events.js:110:17)\r\n    at maybeClose (child_process.js:1015:16)\r\n    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)\r\n```\r\n\r\nThis is using ied master as of today (https://github.com/alexanderGugel/ied/commit/54aff07790bb6ffa15e972e06c1ea62b41325503).\r\n\r\nDoing some digging, and putting in some print statements indicates that this is caused by a `require('hawk')` via `require('request')`, ultimately during the `install` script defined in [`phantomjs-prebuilt`](https://github.com/Medium/phantomjs/blob/d5cb549c5050ee282ba439fc6ab028de4d3bdfdb/package.json#L38).\r\n\r\nSeems like a race condition, where hawk is still in the process of being downloaded when lifecycle scripts begin executing.\r\n\r\nThe package.json is an edited version of an internal codebase, and is very much a real-world scenario that I assume ied (as an npm replacement) would want to be able to handle.\r\n\r\nNot sure how best to describe this, so feel free to edit the title of this issue. Also, thanks for creating a great tool, I can't wait to start using it for real!"}}
{"actor":{"display_login":"alexanderGugel"}}