Laravel 长生不老药 linux

Laravel elixir on linux

我正在使用 Linux Mint,我正在尝试 运行 编译 sass 文件。 我已经安装了 npm 和节点。但是当我 运行 gulp 时,它不会编译并且不会在 public 目录中生成 css 文件。 当我 运行 它时,它没有显示任何错误或任何东西。

如何在Laravel 5.2中编译sass文件?谢谢!

编辑:这是截图:

Gulpfile.js 是:

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

我的 app.scss 文件是:

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

li {
  color: red;
}

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

然后我运行: whereis nodejs 输出为:

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 运行: ln -s /usr/bin/nodejs /usr/bin/node

可是当我运行gulp还是一样

您是否尝试过像下面的代码那样指定 css 文件?

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


希望这能解决您的问题!