npm ERR! Tracker "idealTree:inflate:" already exists

Viewed 9270

Every time I try to install packages using npm install, I'm getting npm ERR! Tracker "idealTree:inflate:" already exists error.

I've tried removing node_modules and clearing cache, but no luck for me.

4 Answers

I had the same issue when trying to update a v1 lockfile to v2 with npmv7, as it seems to be the case in your codebase, and the only way to make it work was to delete the lockfile, clear the cache and do a npm i again with the --prefer-dedupe flag. With the package-lock rebuilt, npm i with no flag worked again, as did npm ci.

Before that, I tried npm i --legacy-peer-deps as it seemed to mimic npm v6 not installing peer dependencies and it failed too, however I think it's interesting to know this flag exists, check out the npm 7 announcement page for more clues : https://github.blog/2021-02-02-npm-7-is-now-generally-available/#peer-dependencies

TLDR

rm package-lock.json
npm cache clear --force
npm i --prefer-dedupe

What worked for me was:

  • Remove package-lock.json and node_modules on the project root.
  • npm cache clear --force
  • npm install --legacy-peer-deps

Note: I need to install the dependencies with the flag because of the nature of the project, but it should work just by normally reinstalling the deps with npm install.

This error occurs in node v14, I upgrade to node v16.17.0 fix it

Related