pacote-old: Build failed ERR_STREAM_WRITE_AFTER_END: node v9.7.1 withExEditorHost v3.0.3 archlinux x86_64

$ git clone ...
$ cd withExEditorHost
$ npm run setup

> withexeditorhost@3.0.3 setup /home/sputnick/sources/withExEditorHost
> npm install && node ./index.js --setup

npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm ERR! code ERR_STREAM_WRITE_AFTER_END
npm ERR! write after end

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/sputnick/.npm/_logs/2018-03-04T20_51_42_936Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! withexeditorhost@3.0.3 setup: `npm install && node ./index.js --setup`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the withexeditorhost@3.0.3 setup script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/sputnick/.npm/_logs/2018-03-04T20_51_43_725Z-debug.log

$ cat ~/.npm/_logs/2018-03-04T20_45_46_514Z-debug.log
(...)
4748 silly extract type-check@0.3.2
4749 silly pacote trying type-check@~0.3.2 by hash: sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=
4750 silly pacote data for sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= not present. Using manifest.
4751 verbose stack Error [ERR_STREAM_WRITE_AFTER_END]: write after end
4751 verbose stack     at writeAfterEnd (_stream_writable.js:237:12)
4751 verbose stack     at PassThrough.Writable.write (_stream_writable.js:287:5)
4751 verbose stack     at PassThrough.Writable.end (_stream_writable.js:572:10)
4751 verbose stack     at ReadEntry.entry.on (/usr/lib/node_modules/npm/node_modules/pacote/lib/extract-stream.js:19:41)
4751 verbose stack     at ReadEntry.emit (events.js:132:15)
4751 verbose stack     at ReadEntry.emit (/usr/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:287:25)
4751 verbose stack     at ReadEntry.[maybeEmitEnd] (/usr/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:240:12)
4751 verbose stack     at ReadEntry.end (/usr/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:153:27)
4751 verbose stack     at Unpack.[consumeBody] (/usr/lib/node_modules/npm/node_modules/tar/lib/parse.js:210:13)
4751 verbose stack     at Unpack.[consumeChunkSub] (/usr/lib/node_modules/npm/node_modules/tar/lib/parse.js:391:40)
4751 verbose stack     at Unpack.[consumeChunk] (/usr/lib/node_modules/npm/node_modules/tar/lib/parse.js:360:30)
4751 verbose stack     at Unzip.(anonymous function).on.chunk (/usr/lib/node_modules/npm/node_modules/tar/lib/parse.js:291:59)
4751 verbose stack     at Unzip.emit (events.js:127:13)
4751 verbose stack     at Unzip.emit (/usr/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:287:25)
4751 verbose stack     at Unzip.write (/usr/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js:90:17)
4751 verbose stack     at Unzip.write (/usr/lib/node_modules/npm/node_modules/tar/node_modules/minizlib/index.js:284:29)
4752 verbose cwd /home/sputnick/sources/withExEditorHost
4753 verbose Linux 4.15.6-1-ARCH
4754 verbose argv "/usr/bin/node" "/usr/bin/npm" "install"
4755 verbose node v9.7.1
4756 verbose npm  v5.7.1
4757 error code ERR_STREAM_WRITE_AFTER_END
4758 error write after end
4759 verbose exit [ 1, true ]

Initially posted here: https://github.com/asamuzaK/withExEditorHost/issues/32

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 4
  • Comments: 24 (16 by maintainers)

Commits related to this issue

Most upvoted comments

I still see this happening on node 10 and npm 6.1.0 (inside a Docker), running npm ci. Was cipm updated with latest pacote?

events.js:167
      throw er; // Unhandled 'error' event
      ^

Error [ERR_STREAM_WRITE_AFTER_END]: write after end
    at writeAfterEnd (_stream_writable.js:243:12)
    at PassThrough.Writable.write (_stream_writable.js:292:5)
    at PassThrough.Writable.end (_stream_writable.js:592:10)
    at ReadEntry.entry.on (/opt/node-v10.0.0-linux-x64/lib/node_modules/npm/node_modules/libcipm/node_modules/pacote/lib/extract-stream.js:19:41)
    at ReadEntry.emit (events.js:187:15)
    at ReadEntry.emit (/opt/node-v10.0.0-linux-x64/lib/node_modules/npm/node_modules/minipass/index.js:309:30)
    at ReadEntry.[maybeEmitEnd] (/opt/node-v10.0.0-linux-x64/lib/node_modules/npm/node_modules/minipass/index.js:257:12)
    at ReadEntry.end (/opt/node-v10.0.0-linux-x64/lib/node_modules/npm/node_modules/minipass/index.js:167:27)
    at Unpack.[consumeBody] (/opt/node-v10.0.0-linux-x64/lib/node_modules/npm/node_modules/tar/lib/parse.js:210:13)
    at Unpack.[consumeChunkSub] (/opt/node-v10.0.0-linux-x64/lib/node_modules/npm/node_modules/tar/lib/parse.js:391:40)
    at Unpack.[consumeChunk] (/opt/node-v10.0.0-linux-x64/lib/node_modules/npm/node_modules/tar/lib/parse.js:362:30)
    at Unzip.(anonymous function).on.chunk (/opt/node-v10.0.0-linux-x64/lib/node_modules/npm/node_modules/tar/lib/parse.js:291:59)
    at Unzip.emit (events.js:182:13)
    at Unzip.emit (/opt/node-v10.0.0-linux-x64/lib/node_modules/npm/node_modules/minipass/index.js:309:30)
    at Unzip.write (/opt/node-v10.0.0-linux-x64/lib/node_modules/npm/node_modules/minipass/index.js:104:17)
    at Unzip.write (/opt/node-v10.0.0-linux-x64/lib/node_modules/npm/node_modules/minizlib/index.js:284:29)
Emitted 'error' event at:
    at writeAfterEnd (_stream_writable.js:245:10)
    at PassThrough.Writable.write (_stream_writable.js:292:5)
    [... lines matching original stack trace ...]
    at Unzip.write (/opt/node-v10.0.0-linux-x64/lib/node_modules/npm/node_modules/minizlib/index.js:284:29)

is there an ETA on 6.1.1?

we’ve done all the updates and next release should fix npm ci. This should work fine with npm install until then.

I manually updated pacote inside libcipm to the latest version and it seems to fix the problem. Comon guys!

OH DUH.

libcipm.

Thank you, yes. I’ll bump that version now. I missed that one 😃

@kimown 5.6.0 seems fine, I think node 9 needs at least that anyway.

The other images don’t have the latest npm. The error occurs pretty consistently for node 8.9.4 and 9.7.1 across the node:x.x.x, node:x.x.x-alpine and mhart/node-alpine images if npm is upgraded to 5.7.1

ARG NODE_VERSION=9.7.1
FROM node:$NODE_VERSION
#FROM node:$NODE_VERSION-alpine
#FROM mhart/alpine-node:$NODE_VERSION
WORKDIR /app
RUN echo '{"dependencies":{"react": "^16", "webpack":"^4", "nyc": "^11", "mocha":"^5"}}' > package.json
RUN npm -v && npm install -g npm && npm install