Why did package-lock.json change the integrity hash from sha1 to sha512?

后端 未结 7 937
日久生厌
日久生厌 2021-01-31 23:50

I just generated a new npm lockfile, package-lock.json, as part of my typical workflow. But I noticed that this time all of the integrity hashes have been changed from sha1 to s

7条回答
  •  生来不讨喜
    2021-02-01 00:38

    Building on what Dave answered. The fix i found was to do the following:

    npm i -g npm
    
    cd {working directory}
    rm -rf node_modules/
    rm package-lock.json
    npm cache clear --force
    npm i
    

    We did this for all our developers at the same time and this stopped the sha-512 vs sha-1 issue which was causing frustrating merge conflicts.

提交回复
热议问题