The problem-
In my existing Vue project if I am running the yarn install
or yarn add package_name
command, the following errors are occurring-
What I read-
After reading this article (scroll down to the "Integrity Hash" section), I was able to achieve some understanding about this error that-
yarn will compute a hash value for each dependency install based on the contents that were downloaded. Next time you download that dependency, yarn generates the hash again. If there is a mismatch between the new value and the value stored in yarn.lock, yarn will throw an error that looks like this:
Integrity check failed for <package-name> (computed integrity doesn't match our records, got <integrity-hash-value>
)
I believe my error is related. The solution also suggested in this article is to read about the culprit dependency and if it's safe to use, re-install this. I also read this GitHub issue.
My concern-
As far as I read, once a resolved version is specified in yarn.lock
that will always be the version installed whenever you run yarn install
. In my yarn.lock
the version of yargs-parser
is 20.2.1
.
Should I re-install this yargs-parser
dependency, if yes, then how? I am kind of worried about the re-installation impact on other dependencies.
My environment details-
The following package managers are installed globally in my system-
node- 14.19.0
yarn- 1.22.4
npm- 6.14.16
I can provide further details if needed. Any help would do great.