{"action":"closed","issue":{"url":"https://api.github.com/repos/npm/npm/issues/17158","repository_url":"https://api.github.com/repos/npm/npm","labels_url":"https://api.github.com/repos/npm/npm/issues/17158/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/17158/comments","events_url":"https://api.github.com/repos/npm/npm/issues/17158/events","html_url":"https://github.com/npm/npm/issues/17158","id":235417730,"number":17158,"title":"npm run that contains \"yes\" piped into a program hangs forever","user":{"login":"esprehn","id":415779,"avatar_url":"https://avatars2.githubusercontent.com/u/415779?v=3","gravatar_id":"","url":"https://api.github.com/users/esprehn","html_url":"https://github.com/esprehn","followers_url":"https://api.github.com/users/esprehn/followers","following_url":"https://api.github.com/users/esprehn/following{/other_user}","gists_url":"https://api.github.com/users/esprehn/gists{/gist_id}","starred_url":"https://api.github.com/users/esprehn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esprehn/subscriptions","organizations_url":"https://api.github.com/users/esprehn/orgs","repos_url":"https://api.github.com/users/esprehn/repos","events_url":"https://api.github.com/users/esprehn/events{/privacy}","received_events_url":"https://api.github.com/users/esprehn/received_events","type":"User","site_admin":false},"labels":[{"id":189882,"url":"https://api.github.com/repos/npm/npm/labels/node-bug","name":"node-bug","color":"6AB417","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-06-13T02:26:19Z","updated_at":"2017-07-06T03:49:55Z","closed_at":"2017-07-06T03:49:55Z","body":"#### I'm opening this issue because:\r\n\r\n  - [X] npm is doing something I don't understand.\r\n\r\n#### What's going wrong?\r\n\r\nIf you use \"yes | command\" in an npm script, either directly or indirectly (ex. inside a shell script) it seems that something about the environment results in yes never ending taking 100% of your CPU.\r\n\r\nex.\r\n\r\n```\r\n\"scripts\": {\r\n    \"my-command\": \"yes | ls\"\r\n},\r\n```\r\n\r\nor \r\n\r\n```\r\n\"scripts\": {\r\n  \"my-command\": \"./script.sh\"\r\n},\r\n\r\nscript.sh:\r\n#!/bin/bash\r\n\r\nyes | ls\r\n```\r\n\r\nIn both these cases \"npm run my-command\" will hang forever running \"yes\".\r\n\r\n#### How can the CLI team reproduce the problem?\r\n\r\nAdd the example above and do npm run my-command.\r\n\r\n### supporting information:\r\n\r\n - `npm -v` prints: 4.6.1\r\n - `node -v` prints: v6.10.3\r\n - `npm config get registry` prints: https://registry.npmjs.org/\r\n - Windows, OS X/macOS, or Linux?: OS X\r\n"}}
{"actor":{"display_login":"iarna"}}