Laravel Scss编译失败 [英] Laravel scss compiling fails
问题描述
我正在尝试学习laravel并在Windows 10上使用composer建立一个新项目
I'm trying to learn laravel and set up a new project with composer on Windows 10
如果我尝试编译
资源\资产\ sass \ app.scss
resources\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 of sass/c:\Users\Michael\www\demolaravel\resources\assets\sass\app.scss
>> @import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap";
为什么他抱怨该目录-app.css(至少这一行)也是原始的.这是作曲家的安装方式.
why he complains about that dir - also the app.css (at least this particular line) is original. It's the way composer installs it.
// 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;
}
我刚刚在最后添加了主体选择器我使用Visual Studio代码和实时sass编译器扩展.但是我也尝试了Scout-App也试图把绝对路径,但没有用:(
I just added the body selector at the end I work with visual studio code and the live sass compiler extension. But I also tried Scout-App also tried puting the absolute path but nothing works :(
推荐答案
似乎您并未安装所有节点依赖项.
It seems you didn't installed all your node dependencies.
在您的项目上运行此命令 npm install
.
Run this command npm install
on your project.
@import
这样写
@import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap";
使用 npm run dev
这篇关于Laravel Scss编译失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!