{"action":"created","issue":{"url":"https://api.github.com/repos/sindresorhus/execa/issues/58","repository_url":"https://api.github.com/repos/sindresorhus/execa","labels_url":"https://api.github.com/repos/sindresorhus/execa/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/sindresorhus/execa/issues/58/comments","events_url":"https://api.github.com/repos/sindresorhus/execa/issues/58/events","html_url":"https://github.com/sindresorhus/execa/issues/58","id":181006902,"number":58,"title":"Crash when running file without execute permissions","user":{"login":"stigok","id":952936,"avatar_url":"https://avatars.githubusercontent.com/u/952936?v=3","gravatar_id":"","url":"https://api.github.com/users/stigok","html_url":"https://github.com/stigok","followers_url":"https://api.github.com/users/stigok/followers","following_url":"https://api.github.com/users/stigok/following{/other_user}","gists_url":"https://api.github.com/users/stigok/gists{/gist_id}","starred_url":"https://api.github.com/users/stigok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stigok/subscriptions","organizations_url":"https://api.github.com/users/stigok/orgs","repos_url":"https://api.github.com/users/stigok/repos","events_url":"https://api.github.com/users/stigok/events{/privacy}","received_events_url":"https://api.github.com/users/stigok/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-04T21:15:32Z","updated_at":"2016-10-05T08:30:45Z","closed_at":null,"body":"Steps to reproduce:\r\n\r\n1. Create a normal file `touch foo.sh`\r\n2. `chmod -x foo.sh` to be explicit.\r\n3. `npm i execa`\r\n3. Run `execa('foo.sh')` as below\r\n\r\n```\r\n// index.js\r\nconst execa = require('execa')\r\nexeca(__dirname + '/foo.sh')\r\n  .then(() => console.log('Ran successfully'))\r\n  .catch(err => console.error('Caught an error', err))\r\n```\r\n\r\nCrashes with error message\r\n```\r\n/repos/node_modules/execa/index.js:120\r\n        spawned.then = promise.then.bind(promise);\r\n                     ^\r\n\r\nTypeError: Cannot set property 'then' of undefined\r\n    at module.exports (/repos/node_modules/execa/index.js:120:15)\r\n    at Object.<anonymous> (/repos/index.js:2:1)\r\n    at Module._compile (module.js:556:32)\r\n    at Object.Module._extensions..js (module.js:565:10)\r\n    at Module.load (module.js:473:32)\r\n    at tryModuleLoad (module.js:432:12)\r\n    at Function.Module._load (module.js:424:3)\r\n    at Module.runMain (module.js:590:10)\r\n    at run (bootstrap_node.js:394:7)\r\n    at startup (bootstrap_node.js:149:9)\r\n```"},"comment":{"url":"https://api.github.com/repos/sindresorhus/execa/issues/comments/251613972","html_url":"https://github.com/sindresorhus/execa/issues/58#issuecomment-251613972","issue_url":"https://api.github.com/repos/sindresorhus/execa/issues/58","id":251613972,"user":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"created_at":"2016-10-05T08:30:45Z","updated_at":"2016-10-05T08:30:45Z","body":"I just released a new version with some major changes. Is it still reproducible? If yes, would you mind submitting a [failing test](https://github.com/avajs/ava#failing-tests)?"}}
{"actor":{"display_login":"sindresorhus"}}