6

I'm using Linux Mint and I'm trying to run compile sass file. I have installed npm and node. But when I run gulp , it doesn't compile and it doesn't make css file in public directory. When I run it, itdoesn't show any error or anything.

How should I compile sass file in Laravel 5.2? Thanks!

Edited: This is the screenshot: Screenshot

Gulpfile.js is:

var elixir = require('laravel-elixir');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */

elixir(function(mix) {
    mix.sass('app.scss');
});

My app.scss file is:

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

li {
  color: red;
}

Updated: When I ran again `npm install` there is this error:
screen-shot

Then I ran: whereis nodejs and output was:

nodejs: /usr/bin/nodejs /usr/lib/nodejs /usr/bin/X11/nodejs /usr/include/nodejs /usr/share/man/man1/nodejs.1.gz

and to link nodejs to node symlink I ran: ln -s /usr/bin/nodejs /usr/bin/node

But when I run gulp still the same.

Mikko
  • 1,877
  • 1
  • 25
  • 37
ivva
  • 2,819
  • 9
  • 31
  • 64
  • 1
    Please update your question with the output of the console after running gulp. Also have you ran npm install before running gulp? – haakym May 01 '16 at 17:53
  • I updated my question. – ivva May 01 '16 at 17:59
  • Post your gulpfile.js – Josh May 01 '16 at 18:10
  • I updated my question. – ivva May 01 '16 at 18:15
  • Have you got anything in your app.scss file for it to compile? – haakym May 01 '16 at 18:30
  • Yes, I have, I posted it. I've run gulp on windows and it has worked. Now, when I try it on linux, it's not. Maybe I haven't something installed. – ivva May 01 '16 at 18:36
  • 1
    Weird. I'm guessing if you were missing something you'd see some errors in the console. Unsure how to debug such an issue, sorry! My last guess is it could be do to with file paths perhaps search your project folder for the compiled file or recompiling with explicit path? Also, it may be worth stating in your question what Linux distro you're using and if you're running gulp on your os or on in a vm like homestead. – haakym May 01 '16 at 19:27
  • 1
    Oh and you could always make an issue here to get help: https://github.com/laravel/elixir/issues – haakym May 01 '16 at 19:30
  • 1
    I'm using Linux Mint. I'll post question there and try again.. – ivva May 01 '16 at 19:43
  • 1
    All the best. Hope you find your answer – haakym May 01 '16 at 20:28
  • Have you installed the dependencies using the command `npm install` in the directory `/var/www/html/Laravel` so that you would have a directory named `node_modules`? – Burak May 02 '16 at 04:49
  • I updated my question. There are errors when I ran it again. – ivva May 02 '16 at 07:22

1 Answers1

2

Did you try specifying the css file like in the code below?

var elixir = require('laravel-elixir');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */

elixir(function(mix) {
    mix.sass('app.scss');
        .version('css/app.css');
});


I hope this solves your problem!

Schwesi
  • 4,753
  • 8
  • 37
  • 62