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

后端 未结 7 949
日久生厌
日久生厌 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:34

    Further building on previous comments and suggestions, for me I needed to wipe the existing node_modules folder, the cache, and then grab the sha512 package-lock.json file from git (which was committed from another computer), and finally do an npm i. Something like this:

    npm i -g npm
    rm -rf node_modules/
    npm cache clear --force
    git reset --hard
    npm i
    

    After this package-lock.json used sha512 and other changes stabilized.

提交回复
热议问题