spawn E2BIG
I've been using gh-pages for quite a while. Today while I tried to deploy my website (npm run deploy), i get the error below. Any help would be appreciated.
% npm run deploy
> [projectname] deploy [root]
> gh-pages -d public -b master -r [git_url] -v '**/*' -f
spawn E2BIG
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [projectname] deploy: `gh-pages -d public -b master -r [git_url] -v '**/*' -f`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [projectname] deploy 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! ~/.npm/_logs/2021-06-29T03_48_37_041Z-debug.log
Here's the log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'deploy' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predeploy', 'deploy', 'postdeploy' ]
5 info lifecycle [projectname]~predeploy: [projectname]
6 info lifecycle [projectname]~deploy: [projectname]
7 verbose lifecycle [projectname]~deploy: unsafe-perm in lifecycle true
8 verbose lifecycle [projectname]~deploy: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:[root]/node_modules/.bin:~/google-cloud-sdk/bin:/opt/anaconda3/bin/:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin
9 verbose lifecycle [projectname]~deploy: CWD: [root]
10 silly lifecycle [projectname]~deploy: Args: [
10 silly lifecycle '-c',
10 silly lifecycle "gh-pages -d public -b master -r [git_url] -v '**/*' -f"
10 silly lifecycle ]
11 silly lifecycle [projectname]~deploy: Returned: code: 1 signal: null
12 info lifecycle [projectname]~deploy: Failed to exec deploy script
13 verbose stack Error: [projectname] deploy: `gh-pages -d public -b master -r [git_url] -v '**/*' -f`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:310:20)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:310:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid [projectname]
15 verbose cwd [root]
16 verbose Darwin 20.5.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "deploy"
18 verbose node v12.16.3
19 verbose npm v6.14.9
20 error code ELIFECYCLE
21 error errno 1
22 error [projectname] deploy: `gh-pages -d public -b master -r [git_url] -v '**/*' -f`
22 error Exit status 1
23 error Failed at the [projectname] deploy script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
HI @artt did you solve it? I have the problem
Ah it's been too long I don't remember now. I just use Vercel nowadays.
FYI: I have the same problem when I use version 6 of gh-pages. However, version 5 and older are still working.
I ran into the same problem after I accidentally "deployed" from the wrong directory: after that trying to deploy correctly caused "spawn E2BIG" error.
This error indicates that a generated command line is too big. In my case, gh-pages tried to remove too many files in one go here: https://github.com/tschaub/gh-pages/blob/e90a1a1d4c0862786b51852d823f434b664db560/lib/git.js#L142
I had to patch it to delete files in batches and it worked.