Bad Pussycat
Bad Pussycat

Reputation: 386

Laravel scss compiling fails

I'm trying to learn laravel and set up a new project with composer on Windows 10

if I try to compile the

resources\assets\sass\app.scss

I got the following error

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";

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;
}

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 :(

Upvotes: 0

Views: 1350

Answers (2)

Zayn Ali
Zayn Ali

Reputation: 4915

It seems you didn't installed all your node dependencies.

Run this command npm install on your project.

the @import write like this

@import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap"; 

compile new css with npm run dev

Upvotes: 1

Sazzadur Rahman
Sazzadur Rahman

Reputation: 2930

First make sure you have installed node and npm globally. Then delete the node_modules directory from you project, and run

npm rebuild node-sass

This command may take some times to execute. After that go to your project directory and run npm install. Then compile your assets with laravel-mix.

I also faced the the same problem in linux environment and I have come across with this solution.

Upvotes: 0

Related Questions