{"action":"created","issue":{"url":"https://api.github.com/repos/npm/npm/issues/19989","repository_url":"https://api.github.com/repos/npm/npm","labels_url":"https://api.github.com/repos/npm/npm/issues/19989/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/19989/comments","events_url":"https://api.github.com/repos/npm/npm/issues/19989/events","html_url":"https://github.com/npm/npm/issues/19989","id":303013169,"number":19989,"title":"npm install fails with \"Error: write after end\" or \"ERR_STREAM_WRITE_AFTER_END\" on 5.7.x","user":{"login":"deployable","id":2499983,"avatar_url":"https://avatars2.githubusercontent.com/u/2499983?v=4","gravatar_id":"","url":"https://api.github.com/users/deployable","html_url":"https://github.com/deployable","followers_url":"https://api.github.com/users/deployable/followers","following_url":"https://api.github.com/users/deployable/following{/other_user}","gists_url":"https://api.github.com/users/deployable/gists{/gist_id}","starred_url":"https://api.github.com/users/deployable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deployable/subscriptions","organizations_url":"https://api.github.com/users/deployable/orgs","repos_url":"https://api.github.com/users/deployable/repos","events_url":"https://api.github.com/users/deployable/events{/privacy}","received_events_url":"https://api.github.com/users/deployable/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":23,"created_at":"2018-03-07T08:56:20Z","updated_at":"2018-03-24T12:24:56Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"#### I'm opening this issue because:\r\n\r\n  - [x] npm is crashing.\r\n  - [ ] npm is producing an incorrect install.\r\n  - [ ] npm is doing something I don't understand.\r\n  - [ ] Other (_see below for feature requests_):\r\n\r\n#### What's going wrong?\r\n\r\nAn `npm install` is failing on npm 5.7.x during extraction of larger projects, most of the time. The issue appears to be related to the update of pacote in 5.7.0: https://github.com/zkat/pacote/issues/142\r\n\r\nv8.9.4\r\n```\r\n7420 silly pacote data for sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg== not present. Using manifest.\r\n7421 verbose stack Error: write after end\r\n7421 verbose stack     at writeAfterEnd (_stream_writable.js:236:12)\r\n7421 verbose stack     at PassThrough.Writable.write (_stream_writable.js:287:5)\r\n7421 verbose stack     at PassThrough.Writable.end (_stream_writable.js:553:10)\r\n7421 verbose stack     at ReadEntry.entry.on (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/extract-stream.js:19:41)\r\n7421 verbose stack     at emitOne (events.js:121:20)\r\n7421 verbose stack     at ReadEntry.emit (events.js:211:7)\r\n7421 verbose stack     at ReadEntry.emit (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:287:25)\r\n7421 verbose stack     at ReadEntry.[maybeEmitEnd] (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:240:12)\r\n7421 verbose stack     at ReadEntry.end (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:153:27)\r\n7421 verbose stack     at Unpack.[consumeBody] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:210:13)\r\n7421 verbose stack     at Unpack.[consumeChunkSub] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:391:40)\r\n7421 verbose stack     at Unpack.[consumeChunk] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:360:30)\r\n7421 verbose stack     at Unzip.(anonymous function).on.chunk (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:291:59)\r\n7421 verbose stack     at emitOne (events.js:116:13)\r\n7421 verbose stack     at Unzip.emit (events.js:211:7)\r\n7421 verbose stack     at Unzip.emit (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:287:25)\r\n7422 verbose cwd /app\r\n7423 verbose Linux 4.9.60-linuxkit-aufs\r\n7424 verbose argv \"/usr/local/bin/node\" \"/usr/local/bin/npm\" \"install\"\r\n7425 verbose node v8.9.4\r\n7426 verbose npm  v5.7.1\r\n7427 error write after end\r\n7428 verbose exit [ 1, true ]\r\n```\r\nv9.7.1\r\n```\r\n7410 silly pacote data for sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw== not present. Using manifest.\r\n7411 verbose stack Error [ERR_STREAM_WRITE_AFTER_END]: write after end\r\n7411 verbose stack     at writeAfterEnd (_stream_writable.js:237:12)\r\n7411 verbose stack     at PassThrough.Writable.write (_stream_writable.js:287:5)\r\n7411 verbose stack     at PassThrough.Writable.end (_stream_writable.js:572:10)\r\n7411 verbose stack     at ReadEntry.entry.on (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/extract-stream.js:19:41)\r\n7411 verbose stack     at ReadEntry.emit (events.js:132:15)\r\n7411 verbose stack     at ReadEntry.emit (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:287:25)\r\n7411 verbose stack     at ReadEntry.[maybeEmitEnd] (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:240:12)\r\n7411 verbose stack     at ReadEntry.end (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:153:27)\r\n7411 verbose stack     at Unpack.[consumeBody] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:210:13)\r\n7411 verbose stack     at Unpack.[consumeChunkSub] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:391:40)\r\n7411 verbose stack     at Unpack.[consumeChunk] (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:360:30)\r\n7411 verbose stack     at Unzip.(anonymous function).on.chunk (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:291:59)\r\n7411 verbose stack     at Unzip.emit (events.js:127:13)\r\n7411 verbose stack     at Unzip.emit (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:287:25)\r\n7411 verbose stack     at Unzip.write (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:90:17)\r\n7411 verbose stack     at Unzip.write (/usr/local/lib/node_modules/npm/node_modules/tar/node_modules/minizlib/index.js:284:29)\r\n7412 verbose cwd /app\r\n7413 verbose Linux 4.9.60-linuxkit-aufs\r\n7414 verbose argv \"/usr/local/bin/node\" \"/usr/local/bin/npm\" \"install\"\r\n7415 verbose node v9.6.1\r\n7416 verbose npm  v5.7.1\r\n7417 error code ERR_STREAM_WRITE_AFTER_END\r\n7418 error write after end\r\n7419 verbose exit [ 1, true ]\r\n```\r\n\r\n#### How can the CLI team reproduce the problem?\r\n\r\nDockerfile\r\n```\r\nARG NODE=9.7.1\r\nARG NPM=5.7.1\r\nFROM node:$NODE\r\n#FROM node:$NODE_VERSION-alpine\r\n#FROM mhart/alpine-node:$NODE_VERSION\r\nWORKDIR /app\r\nRUN echo '{\"dependencies\":{\"react\": \"^16\", \"webpack\":\"^4\", \"nyc\": \"^11\", \"mocha\":\"^5\"}}' > package.json\r\nRUN npm install -g npm@$NPM \r\nRUN npm install\r\n```\r\n```\r\ndocker build --build-arg NODE=8.9.4 --build-arg NPM=5.7.1 .\r\ndocker build --build-arg NODE=8.9.4 --build-arg NPM=5.7.0 .\r\ndocker build --build-arg NODE=9.7.1 --build-arg NPM=5.7.1 .\r\ndocker build --build-arg NODE=9.7.1 --build-arg NPM=5.7.0 .\r\n```\r\nThe same error occurs in the `node` alpine and `mhart/alpine-node` images\r\n\r\n### supporting information:\r\n - See repro for versions\r\n - Docker for Mac 17.12.0-ce, OSX 10.11\r\n - Container:\r\n   - [ ] I develop using Vagrant on Windows.\r\n   - [ ] I develop using Vagrant on OS X or Linux.\r\n   - [x] I develop / deploy using Docker.\r\n   - [ ] I deploy to a PaaS (Triton, Heroku)."},"comment":{"url":"https://api.github.com/repos/npm/npm/issues/comments/375883544","html_url":"https://github.com/npm/npm/issues/19989#issuecomment-375883544","issue_url":"https://api.github.com/repos/npm/npm/issues/19989","id":375883544,"user":{"login":"oshliaer","id":5027939,"avatar_url":"https://avatars2.githubusercontent.com/u/5027939?v=4","gravatar_id":"","url":"https://api.github.com/users/oshliaer","html_url":"https://github.com/oshliaer","followers_url":"https://api.github.com/users/oshliaer/followers","following_url":"https://api.github.com/users/oshliaer/following{/other_user}","gists_url":"https://api.github.com/users/oshliaer/gists{/gist_id}","starred_url":"https://api.github.com/users/oshliaer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oshliaer/subscriptions","organizations_url":"https://api.github.com/users/oshliaer/orgs","repos_url":"https://api.github.com/users/oshliaer/repos","events_url":"https://api.github.com/users/oshliaer/events{/privacy}","received_events_url":"https://api.github.com/users/oshliaer/received_events","type":"User","site_admin":false},"created_at":"2018-03-24T12:24:55Z","updated_at":"2018-03-24T12:24:55Z","author_association":"NONE","body":"@EugeneAndrievsky , try [Node Version Manager ](https://github.com/creationix/nvm) It's great tool without admins, sudoers, reboots and yada-yada"}}
{"actor":{"display_login":"oshliaer"}}