Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 970
Delowar Hosain Avatar asked Nov 14 '22 19:11

Delowar Hosain


1 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
like image 138
JJP Avatar answered Dec 07 '22 23:12

JJP