question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ionic build: Error in subprocess stdout pipe: Error [ERR_STREAM_WRITE_AFTER_END]: write after end at writeAfterEnd

See original GitHub issue

Description: I’m getting the following error when I run ionic build --prod

Output:

ionic build --prod --verbose
  ionic:cli-utils Terminal info: { tty: true, ci: false } +0ms
  ionic:cli-utils CLI global options: { _: [ 'build' ], help: false, h: false, verbose: true, quiet: false, interactive: true, color: true, confirm: false, json: false, prod: true, project: null, '--': [] } +268ms
  ionic:cli-utils:lib:environment Environment open. +0ms
  ionic:cli-utils:lib:project Project type from config: ionic/angular 4 (angular) +0ms
  ionic:cli-utils Project name: undefined +11ms
  ionic:cli Context: { binPath: '/usr/lib/node_modules/ionic/bin/ionic', libPath: '/usr/lib/node_modules/ionic', execPath: '/mnt/c/Users/marce/Documents/Code/xCode/lingusocial-ionic-v4', version: '4.0.0-rc.11' } +0ms
  ionic:cli-utils:lib:hooks Looking for ionic:build:before npm script. +0ms
  ionic:cli-utils:lib:project:angular:build Looking for ionic:build npm script. +0ms
> ng run app:build:production

Date: 2018-07-22T10:20:52.876Z
Hash: f05c78487b891411c436
Time: 13139ms
chunk {0} runtime.a66f828dca56eeb90e02.js (runtime) 1.05 kB [entry] [rendered]
chunk {1} styles.0dd73f3f0a0fd9c590d8.css (styles) 15.1 kB [initial] [rendered]
chunk {2} polyfills.207dcc605630215505f5.js (polyfills) 130 bytes [initial] [rendered]
chunk {3} main.f58b96bf9bf614ca37d4.js (main) 128 bytes [initial] [rendered]
  ionic:cli-utils:lib:shell Error in subprocess stdout pipe: Error [ERR_STREAM_WRITE_AFTER_END]: write after end at writeAfterEnd (_stream_writable.js:241:12) at Object.Writable.write (_stream_writable.js:291:5) at Readable.write (/usr/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:855:33) at DestroyableTransform.ondata (/usr/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:619:20) at DestroyableTransform.emit (events.js:180:13) at addChunk (/usr/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:291:12) at readableAddChunk (/usr/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:278:11) at DestroyableTransform.Readable.push (/usr/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:245:10) at DestroyableTransform.Transform.push (/usr/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_transform.js:148:32) at push (/usr/lib/node_modules/ionic/node_modules/split2/index.js:52:10) +0ms
  ionic:cli-utils:lib:shell Error in subprocess stderr pipe: Error [ERR_STREAM_WRITE_AFTER_END]: write after end at writeAfterEnd (_stream_writable.js:241:12) at Object.Writable.write (_stream_writable.js:291:5) at Readable.write (/usr/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:855:33) at DestroyableTransform.ondata (/usr/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:619:20) at DestroyableTransform.emit (events.js:180:13) at addChunk (/usr/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:291:12) at readableAddChunk (/usr/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:278:11) at DestroyableTransform.Readable.push (/usr/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:245:10) at DestroyableTransform.Transform.push (/usr/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_transform.js:148:32) at push (/usr/lib/node_modules/ionic/node_modules/split2/index.js:52:10) +1ms
[ERROR] An error occurred while running subprocess ng.

        ng run app:build:production exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.
  ionic:cli-framework:utils:process onBeforeExit handler: process.exit received +0ms
  ionic:cli-framework:utils:process onBeforeExit handler: running 1 queued functions +0ms
  ionic:cli-framework:utils:process onBeforeExit handler: exiting (exit code 1) +1ms

My ionic info:


Ionic:

   ionic (Ionic CLI)          : 4.0.0-rc.11 (/usr/lib/node_modules/ionic)
   Ionic Framework            : @ionic/angular 4.0.0-alpha.11
   @angular-devkit/core       : 0.7.0-rc.2
   @angular-devkit/schematics : 0.7.0-rc.2
   @angular/cli               : 6.0.8
   @ionic/ng-toolkit          : 1.0.0-rc.11
   @ionic/schematics-angular  : 1.0.0-rc.11

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : none

System:

   NodeJS : v9.11.2 (/usr/bin/node)
   npm    : 6.2.0
   OS     : Linux 4.4

Environment:

   ANDROID_HOME : not set

Other Information:

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:6
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
SounD120commented, Oct 18, 2018

Have the similar problem on macOS 10.14 when running ionic cordova run android --verbose --no-interactive command.

2018-10-18T10:07:46.629Z ionic:lib:shell Error in subprocess stdout pipe: Error [ERR_STREAM_WRITE_AFTER_END]: write after end at writeAfterEnd (_stream_writable.js:243:12) at Object.Writable.write (_stream_writable.js:291:5) at Readable.write (/usr/local/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:855:33) at DestroyableTransform.ondata (/usr/local/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:619:20) at DestroyableTransform.emit (events.js:182:13) at addChunk (/usr/local/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:291:12) at readableAddChunk (/usr/local/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:278:11) at DestroyableTransform.Readable.push (/usr/local/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:245:10) at DestroyableTransform.Transform.push (/usr/local/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_transform.js:148:32) at push (/usr/local/lib/node_modules/ionic/node_modules/split2/index.js:52:10)
2018-10-18T10:07:46.629Z ionic:lib:shell Error in subprocess stderr pipe: Error [ERR_STREAM_WRITE_AFTER_END]: write after end at writeAfterEnd (_stream_writable.js:243:12) at Object.Writable.write (_stream_writable.js:291:5) at Readable.write (/usr/local/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:855:33) at DestroyableTransform.ondata (/usr/local/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:619:20) at DestroyableTransform.emit (events.js:182:13) at addChunk (/usr/local/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:291:12) at readableAddChunk (/usr/local/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:278:11) at DestroyableTransform.Readable.push (/usr/local/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_readable.js:245:10) at DestroyableTransform.Transform.push (/usr/local/lib/node_modules/ionic/node_modules/readable-stream/lib/_stream_transform.js:148:32) at push (/usr/local/lib/node_modules/ionic/node_modules/split2/index.js:52:10)

ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.2.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0-beta.13
   @angular-devkit/build-angular : 0.8.5
   @angular-devkit/schematics    : 0.8.5
   @angular/cli                  : 6.2.5
   @ionic/angular-toolkit        : 1.0.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.1
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.0, (and 4 other plugins)

System:

   NodeJS : v10.12.0 (/usr/local/Cellar/node/10.12.0/bin/node)
   npm    : 6.4.1
   OS     : macOS
   Xcode  : Xcode 10.0 Build version 10A255
1reaction
marcelgoyacommented, Jul 24, 2018

No, it only said that it couldn’t compile but it didn’t output any specific details

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ionic cordova build android - "Error in subprocess stdout pipe"
I have a project that runs fine on my browser, both using “ionic serve” and “ionic run browser --prod”. Also, I used to...
Read more >
Error: npm ERR! write after end - Stack Overflow
Try installing latest npm version this happens a lot with ionic. npm install -g npm@latest npm cache verify npm i.
Read more >
Ionic Forum - Latest posts - RSSing.com
ionic :lib:shell Error in subprocess stdout pipe: Error [ERR_STREAM_WRITE_AFTER_END]: write after end at writeAfterEnd ...
Read more >
Server crashes with even simplest code. : r/node - Reddit
this is error events.js:352 throw er; // Unhandled 'error' event Error [ERR_STREAM_WRITE_AFTER_END]: write after end at writeAfterEnd…
Read more >
Issue 21619: Cleaning up a subprocess with a broken pipe
ContextManagerTests) Broken pipe error should not prevent wait() ... want the error was silently ignored when write to the subprocess. with ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found