npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

npm ci failed - child.send is not a function

What I Wanted to Do

I run npm ci on solaris.

What Happened Instead

Command failed.

-> % npm ci                                                
npm WARN prepare removing existing node_modules/ before installation
npm ERR! child.send is not a function
npm ERR! child.send is not a function
npm ERR! child.send is not a function
npm ERR! child.send is not a function

npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/.npm/_logs/2018-07-10T13_03_36_059Z-debug.log

Reproduction Steps

Run npm ci on solaris.



Platform Info

$ npm --versions
$ node -p process.platform

Solaris SunOS 11.3
node: 8.9.1

Also failing with npm - 6.2.0

Does node not support child.send on Solaris? That’s a pretty serious omission. I’m surprised npm install works, too, since it should be hitting the same code path here. :thinking:

npm install work fine. I cam send any additional logs etc.

Can you try upgrading to npm@6.2.0 and see if it still reproduces?

I try, with 6.2.0 npm ci also crash

This stack trace is honestly just telling me that there’s a bug in the Solaris version of node. If you take a look at that stack trace, you’ll see that it’s literally Node itself missing that send method:

Can you try running this with node@10 and see if it works? This command will do it without you having to upgrade your node version:

$ npx -p node@10 npm ci

And let me know what you get from this. I don’t know why it would only happen sometimes, and I suspect the reason you get it with npm ci and not npm install is because the former is faster, and thus more likely to run into race conditions. If this problem keeps going, and still happens with the latest node version, I think you’ll have to file a bug with nodejs/node (or just look in their issue tracker for errors with a missing .send() method on ChildProcess instances).

$ npx -p node@10 npm ci failing:

Logs: node: fatal: version 'ILLUMOS_0.8' not found (required by file /tmp/.npm/_npx/604522/lib/node_modules/node/bin/node) node: fatal: open failed: No such file or directory
/usr/bin/npm: line 3: 604583: Killed

I create simple example.


const childProcess = require('child_process');
const childModule  = require.resolve('./child');

const options = {
    env: process.env,
    cwd: process.cwd(),
const child = childProcess.fork(childModule, process.argv, options);

child.on('message', function(data) {
    console.log('m', data);

child.on('error', function(err) {
    console.log('e', err);

child.send({ date: });


process.on('message', function (data) {
    console.log('MES', data);

And it run success, console:

-> % node index.js
MES { date: 1532068611704 }

I add console.log to on error callback:

And in logs receive:

npm ERR! child.send is not a function
unhandled err: { Error: spawn /usr/node/bin/node EAGAIN
    at _errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
  code: 'EAGAIN',
  errno: 'EAGAIN',
  syscall: 'spawn /usr/node/bin/node',
  path: '/usr/node/bin/node',
   [ '/usr/node/lib/node_modules/npm/node_modules/worker-farm/lib/child/index.js',
     'ci' ] }

It seems like a problem with my system. Maybe need improve logs for detect similar problems?

And one more questions, I can limit worker number for npm ci with arguments or process.env?

After research I think it must be added maxConcurrentWorkers option to:

For customize over environment variables. In my case our company use virtual machines, and in:

require('os').cpus().length return 24. But it for all virtual machines and when npm ci runs it exceeds threads limit on virtual machine. P.S. npm ci with maxConcurrentWorkers = 24 use over 200 threads.