Netlify deploy RangeError: Maximum call stack size exceeded
Posted on October 5, 2021 • 1 min read • 136 wordsThis morning I was deploying one of the site on our network to Netlify using the usual command. But after the CDN diffing files I got the following error message RangeError: Maximum call stack size exceeded
This morning I was deploying one of the site on our network to Netlify using the usual command:
netlify deploy --prod
```bash
But after the CDN diffing files I got the following error message
```bash
RangeError: Maximum call stack size exceeded
Firstly, create new file in /usr/bin/node_bin
with the contents below:
#!/bin/bash
/usr/bin/node --stack-size=10000 $@
```bash
You can modify the stack-size number to higher number if needed.
After that, change the file permission to 755.
```bash
sudo chmod 755 /usr/bin/node_bin
Check netlify-cli installation path using which netlify
command. Mine is located at /usr/bin/netlify
since I installed netlify cli globally.
Edit the netlify file, change the first line from:
#!/usr/bin/env node
```bash
to
```bash
#!/usr/bin/env node_bin
This way the node will be invoked with custom --stack-size
number.
I hope this is useful and happy deploying!