Incorrect integrity when fetching from the cache

后端 未结 6 1733
感动是毒
感动是毒 2021-02-01 12:04

When running yarn add --dev jest, I got error Incorrect integrity when fetching from the cache.

Full output:



        
相关标签:
6条回答
  • 2021-02-01 12:47

    You need to run these two commands before installing the package:

    • yarn config set unsafe-disable-integrity-migration false
    • yarn cache clean
    0 讨论(0)
  • 2021-02-01 12:48

    Yarn cache clean did not help. We must downgrading yarn version on the server.

    It turns out that the problem is associated with the use of private packages.

    GitHub Yarnpkg - "Incorrect integrity when fetching from the cache" #7584

    0 讨论(0)
  • 2021-02-01 12:55

    Clean the cache and reinstall:

    yarn cache clean
    yarn install -f
    
    0 讨论(0)
  • 2021-02-01 12:56

    yarn cache clean

    To fix this, run:

    yarn cache clean
    yarn add --dev jest
    

    From the yarn cache documentation:

    yarn cache clean [<module_name...>]

    Running this command will clear the global cache. It will be populated again the next time yarn or yarn install is run. Additionally, you can specify one or more packages that you want to clean.

    You can also see where the cache is with yarn cache dir.

    yarn cache dir

    Running yarn cache dir will print out the path where yarn’s global cache is currently stored.

    0 讨论(0)
  • 2021-02-01 12:58

    Tried to upgrade yarn and it solved my problem. It may be due to the compatibility issue

    yarn policies set-version
    

    Will download the latest stable release

    Reference : yarn docs https://yarnpkg.com/lang/en/docs/cli/policies/#toc-policies-set-version

    0 讨论(0)
  • 2021-02-01 13:10

    For anyone who is working with heroku and sees this error:

    • install heroku cli
    • login via heroku login
    • heroku plugins:install heroku-repo
    • heroku repo:purge_cache -a $YOURAPPNAME

    then do a manual rebuild

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