Maximum call stack size exceeded during npm install

Hi.

I am running into a consistent failure with my build that is running this config: https://gist.github.com/shawnatxapp/621a6307a7d9af0ac94747cf06459206

it routinely throws this error on the ‘Restoring Cache’ step:

Error computing cache key: template: cacheKey:1: unexpected unclosed action in command

And it consistently errors out on the npm install step citing this error:

npm ERR! Maximum call stack size exceeded

In an effort to troubleshoot, I have attempted the following actions:

  1. Upgrade to the latest LTS version of Node (10.14.1) via config.yml
  2. Invalidating the cache by a. changing the key from dependency-cache-{{ checksum "package-lock.json" }} to dependency-cache-v2-{{ checksum "package-lock.json" }}
  3. Disabling the cache process altogether in config.yml/removing package-lock.json from version control

Disabling cache makes the first error stop, but the call stack error throws no matter what.

Has anyone else faced this?

With a little help from the Circle CI team, we were able to fix the issue and are once again operating within the warm glow of continuous deployment.

Here’s what we did, in case anyone else encounters a similar fate in the future:

Change the restore_cache field in *.circleci/config.yml from

- restore_cache:
    keys: dependency-cache-{{ checksum "package-lock.json" }}

to

- restore_cache:
      keys:
        - dependency-cache-v2-{{ checksum "package-lock.json" }}

Manually delete the package-lock.json the & the node_modules directory.

Re run npm install to generate a clean package-lock.json file.

And we are in business!

1 Like

Thanks for taking the time to post the solution here! Im super glad we were able to resolve this with you :smiley:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.