[Solved] Laravel Mix | Bootstrap DEPRECATION WARNING: Using / for division is deprecated and will be removed

Laravel Mohit Mozumder

Problem: 

I installed bootstrap in my laravel application using npm. I use scss to import it when I try to compile, It just shows endless warnings

DEPRECATION WARNING: Using / for division is deprecated and will be removed
in Dart Sass 2.0.0. Recommendation: math.div($spacer, 4) More info and automated migrator: https://sass-lang.com/d/slash-div2531: $spacer / 4, │ ^^^^^^^^^^^ ╵ node_modules\bootstrap\scss\_variables.scss 253:6 @import node_modules\bootstrap\scss\bootstrap.scss 11:9 @import resources\css\app.scss 2:9 root stylesheet


Solution 1:

If you are using npm then add the devDependencies to the package.json file.

"devDependencies": {
    ...,
    "sass": "~1.32.12"
}


Solution 2:

To solve this problem yo have to downgrade to a specific version of a package, in this case SASS, you should:

  1. change "sass": "^1.33.0", to "sass": "1.32.13", in package.json.

  2. delete package-lock.json

  3. delete node_modules folder

  4. run npm install


Note: this will update all of your other packages within NPM. If you do not want to do that, simply remove "sass" from your package-lock.json and that particular folder within node_modules.


Thank you for reading the article. If you have further problem regarding this issue feel free to contact with us.