简体   繁体   English

Laravel webpack 编译错误引导变量未定义

[英]Laravel webpack compile error bootstrap variable undefined

I'm struggling for hours but don't know why I'm getting this on webpack compile command node version 12我挣扎了几个小时,但不知道为什么我在 webpack 编译命令节点版本 12 上得到这个

ERROR in ./node_modules/css-loader??ref--8-2!./node_modules/postcss-loader/lib??postcss!./node_modules/resolve-url-loader??ref--8-4!./node_modules/sass-loader/lib/loader.js??ref--8-5!./resources/assets/sass/main.scss
Module build failed: 
  font-weight: $font-weight-bolder; // Add the correct font weight in Chrome, Edge, and Safari
              ^
      Undefined variable: "$font-weight-bolder".
      in /www/wwwroot/ship-hero.codersarray.com/node_modules/bootstrap/scss/_reboot.scss (line 158, column 16)
 @ ./resources/assets/sass/main.scss 4:14-267
 @ multi ./resources/assets/js/pages/install.js ./resources/assets/sass/main.scss

ERROR in ./resources/assets/sass/main.scss
Module build failed: ModuleBuildError: Module build failed: 
  font-weight: $font-weight-bolder; // Add the correct font weight in Chrome, Edge, and Safari
              ^
      Undefined variable: "$font-weight-bolder".
      in /www/wwwroot/ship-hero.codersarray.com/node_modules/bootstrap/scss/_reboot.scss (line 158, column 16)
    at /www/wwwroot/ship-hero.codersarray.com/node_modules/webpack/lib/NormalModule.js:195:19
    at /www/wwwroot/ship-hero.codersarray.com/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /www/wwwroot/ship-hero.codersarray.com/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/www/wwwroot/ship-hero.codersarray.com/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at Object.callback (/www/wwwroot/ship-hero.codersarray.com/node_modules/sass-loader/lib/loader.js:55:13)
    at Object.done [as callback] (/www/wwwroot/ship-hero.codersarray.com/node_modules/neo-async/async.js:8069:18)
    at options.error (/www/wwwroot/ship-hero.codersarray.com/node_modules/node-sass/lib/index.js:294:32)
 @ ./resources/assets/sass/main.scss
 @ multi ./resources/assets/js/pages/install.js ./resources/assets/sass/main.scss

I already fixed it here is the solution if anyone encounters the same problem the issue is with the bootstrap version according to package.json bootstrap version is ^4.0.0 but on running npm install 4.6 version is being installed that is causing the issue so I just install the specific version that is 4.0.0 changed the value in the package.json from ^4.0.0 to 4.0.0. I already fixed it here is the solution if anyone encounters the same problem the issue is with the bootstrap version according to package.json bootstrap version is ^4.0.0 but on running npm install 4.6 version is being installed that is causing the issue so I只需安装 4.0.0 的特定版本,将 package.json 中的值从 ^4.0.0 更改为 4.0.0。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM