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.

Error: spawn E2BIG

See original GitHub issue

If externals get over a certain number, on macOS 11.5 I’m getting this error when packaging:

Serverless: Compiling to node14 bundle with esbuild...
Serverless: Compiling completed.
Serverless: Package lock found - Using locked versions
Serverless: Packing external modules: < ... list of external modules>
 Error ---------------------------------------------------
 
  Error: spawn E2BIG
      at ChildProcess.spawn (internal/child_process.js:403:11)
      at spawn (child_process.js:580:9)
      at Object.spawnWithSignal [as spawn] (child_process.js:717:17)
      at /Users/.../node_modules/bestzip/lib/bestzip.js:74:29
      at /Users/.../node_modules/bestzip/node_modules/async/dist/async.js:1802:20
      at /Users/.../node_modules/bestzip/node_modules/async/dist/async.js:248:13
      at wrapper (/Users/.../node_modules/bestzip/node_modules/async/dist/async.js:268:20)
      at iterateeCallback (/Users/.../node_modules/bestzip/node_modules/async/dist/async.js:421:28)
      at /Users/.../node_modules/bestzip/node_modules/async/dist/async.js:321:20
      at /Users/.../node_modules/bestzip/node_modules/async/dist/async.js:245:17
      at /Users/.../node_modules/bestzip/node_modules/async/dist/async.js:1792:24
      at /Users/.../node_modules/bestzip/lib/bestzip.js:49:7
      at processTicksAndRejections (internal/process/task_queues.js:77:11)
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              14.17.3
     Framework Version:         2.52.1 (local)
     Plugin Version:            5.4.3
     SDK Version:               4.2.5
     Components Version:        3.14.0
 

Same error using node version 16.5.0.

On a Linux distro it’s running fine though.

Any help would be appreciated.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
floydspacecommented, Sep 19, 2021

Hey @andreasgrimm @mattjennings I think this fix would close this issue. Feel free to reopen if you still encounter it

0reactions
mattjenningscommented, Sep 4, 2021

@floydspace yeah we haven’t had any issues since using it

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: spawn E2BIG · Issue #40 · standard/standard - GitHub
E2BIG means that the argument list is too long. See errors.c where it's defined. I cloned your project and it worked fine for...
Read more >
node.js: gm throws spawn E2BIG error when passed too much ...
I'm not really familiar with node-gm, but I have a feeling that .drawCircle(x1, y1, x2, y2) method just appends a command-line argument ...
Read more >
Solved: 'spawn E2BIG' error with microgateway - Apigee
Solved: I'm getting bellow error with microgateway deployed on openshift. Please suggest. Log Location: [ /opt/apigee/logs/edgemicro.log ] cd.
Read more >
gruntjs/grunt - Gitter
Hey everyone, I was handed a big grunt build process, and this seems to be the error coming : Warning: spawn E2BIG Use...
Read more >
[PM2][ERROR] Process failed to launch spawn E2BIG - Medium
[PM2][ERROR] Process failed to launch spawn E2BIG — [solved]. A couple of weeks ago I ran into an unexpected problem for me.
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