NPM lockfiles/shrinkwrap get random “dl” parameter tacked on to the “resolved” URL

前端 未结 1 614
粉色の甜心
粉色の甜心 2021-02-04 00:31

Our company uses an Artifactory repository for storing internally-published packages and as a proxy for the NPM registry. Sometimes the resolved field in lockfiles/

1条回答
  •  有刺的猬
    2021-02-04 01:24

    I think the root of your problem is likely caching.

    NPM caches packages that have been downloaded, so they don't have to be downloaded again, and they can even be re-installed offline if necessary. It also caches the resolved value for later use. If a package of the same version has already been resolved and downloaded, it doesn't need to go and fetch it again and get the updated download/resolved URL.

    You can manually clear this cache with the following command.

    npm cache clean --force
    

    Alternately, it could be that difference in how different versions of NPM calculate the resolved field are to blame (following the Location header or not). However I think caching is more-likely to blame.

    0 讨论(0)
提交回复
热议问题