NPM: Maximum call stack size exceeded

Posted on Sep 6, 2020

You may have cloned a project and tried running ’npm install’ only to find the following error message:

error Maximum call stack size exceeded

There’s multiple ways I’ve found to fix this:

The Safe ways:

Force clear the NPM cache:

npm cache clean --force
npm install

Rebuild:

npm rebuild
npm install

Remove node_modules:

rm -r node_modules
npm install

The Nuclear way:

rm package-lock.json
rm -r node_modules
npm install

As always, I hope this fixes your problem!