symfonyinstallationbootstrap-4yarnpkg

Error when installing Bootstrap with yarn in symfony Project


I'm try to install bootstrap 4 in my symfony project with yarn command:

error Incorrect integrity when fetching from the cache

I follow guide document for symfony: https://symfony.com/doc/current/frontend/encore/bootstrap.html

I've tried to clear cache, remove yarn dependencies from package.json, reinstall yarn, delete package.json et install again. I also try to give licence for my package.json with the command : "yarn licenses list"

{
  "devDependencies": {
    "@symfony/webpack-encore": "^0.28.0",
    "webpack-notifier": "1.6.0"
  },
  "dependencies": {
    "jquery": "^3.4.1",
    "popper": "^1.0.1"
  },
  "version": "0.0.0"
}

When I try to use : yarn add bootstrap@4 --dev, I get this error :

error Incorrect integrity when fetching from the cache

Warning messsage for each yarn command I execute : No licence field.


Solution

  • yarn cache clean

    I'm gonna go out on a limb and assume that by clearing the cache you removed node_modules, which is not the cache (I made the same mistake).

    See answer here for more detail:

    Incorrect integrity when fetching from the cache