4

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! react-boilerplate@3.7.0 presetup: `npm i chalk shelljs`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the react-boilerplate@3.7.0 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?

Vipul Solanki
  • 313
  • 1
  • 2
  • 19

3 Answers3

2

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

rm -rf node_modules

npm cache clean --f

npm install
Prateek Kapoor
  • 947
  • 9
  • 18
1

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 :(

Vipul Solanki
  • 313
  • 1
  • 2
  • 19
0

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

Ankit Agarwal
  • 30,378
  • 5
  • 37
  • 62