Vipul Solanki
Vipul Solanki

Reputation: 311

React boilerplate : Maximum call stack size exceeded

I'm trying to create react-boilerplate but got bellow error.

npm ERR! Maximum call stack size exceeded

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/dev1/.npm/_logs/2019-02-05T10_12_55_340Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] presetup: `npm i chalk shelljs`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] presetup 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!     /home/dev1/.npm/_logs/2019-02-05T10_12_55_434Z-debug.log

Node version : v8.9.4

I've clone setup from git and run npm run setup command but got this error.

Note: remove node_modues and re-install node_modules - not working uninstall node globaly and re-install node - not working

Can anyone help?

Upvotes: 4

Views: 13281

Answers (3)

Seeker
Seeker

Reputation: 957

I spent few hours resolving this issue. Below solution worked for me

rm -rf node_modules

npm cache clean --f

npm install

Upvotes: 2

Vipul Solanki
Vipul Solanki

Reputation: 311

I checked the npm logs and I saw that it was failing at install @xtuc/ieee754 I found this solution https://github.com/angular/angular-cli/issues/12231

Its likely that you have to remove your ~/.npmrc file.

I tried this and it solved the issue for me.

Hope this helps!

This issue just wasted my 6 hours only :(

Upvotes: 1

Ankit Agarwal
Ankit Agarwal

Reputation: 30739

In such cases you need to manually/explicitly assign the call stack so that the call stack size is increased to perform that operation. You can try:

node --stack-size=16000 <file>

Since you are doing npm run setup so you need to basically change that call stack value in setup script in package.json, something like:

"scripts": {
  "setup": "node --stack-size=16000 index.js"
}

If that still gives the stack size error then try with greater value other than 16000

Upvotes: 0

Related Questions