Laravel scss编译失败
我正在尝试学习laravel,并在Windows 10上与composer建立一个新项目 如果我试图编译 资源\assets\sass\app.scss 我犯了以下错误Laravel scss编译失败,laravel,sass,Laravel,Sass,我正在尝试学习laravel,并在Windows 10上与composer建立一个新项目 如果我试图编译 资源\assets\sass\app.scss 我犯了以下错误 Compilation Error Error: File "c:\Users\Michael\www\demolaravel\resources\assets\sass\node_modules\bootstrap-sass\assets\stylesheets\bootstrap" not found on line 9 o
Compilation Error
Error: File "c:\Users\Michael\www\demolaravel\resources\assets\sass\node_modules\bootstrap-sass\assets\stylesheets\bootstrap" not found
on line 9 of sass/c:\Users\Michael\www\demolaravel\resources\assets\sass\app.scss
>> @import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap";
为什么他抱怨这个目录——还有app.css(至少这一行)是原创的。这是composer安装它的方式
// Fonts
@import url("https://fonts.googleapis.com/css?family=Raleway:300,400,600");
// Variables
@import "variables";
// Bootstrap
@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap";
body{
padding-top: 80px;
}
我刚刚在末尾添加了身体选择器
我使用visualstudio代码和livesass编译器扩展。但我也尝试了Scout应用程序
还尝试放置绝对路径,但没有任何效果:(似乎您没有安装所有的节点依赖项 在项目上运行此命令
npm install
@导入
这样写
@import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap";
使用
npm-run-dev
编译新的css,首先确保您已全局安装node
和npm
。然后从项目中删除node\u-modules
目录,然后运行
npm rebuild node-sass
执行此命令可能需要一些时间。然后转到项目目录并运行npm install
。然后使用laravel mix
编译资产
我在linux环境中也遇到了同样的问题,我遇到了这个解决方案。您是否在您的项目中使用
npm install
安装了依赖项?没有,我忘了。请回答这个问题,我接受抱歉,我安装了npm,它安装了很多文件,但如果我现在更改我的SCS并让它编译,我将接受它我收到了同样的消息。:(是的“node_modules\bootstrap sass”existIt似乎elixir正在尝试从sass
文件夹中查找文件并附加路径,因此尝试此路径,因为从sass目录节点_modules向后3步。@import”。/../node_modules/bootstrap sass/assets/stylesheets/bootstrap”
不幸的是,这条消息不一样:(您使用的是哪一版本的laravel?您现在也在使用Visual studio代码中的live sass编译器扩展。但只有在我的@import
中向上跳转三个目录时,它才会生效)。/../node\u modules/bootstrap sass/assets/stylesheets/bootstrap”谢谢