Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

garygreen's avatar

@codeatbusiness @Zdravko

I sometimes get this. I've always found it to be a caching issue (particularly on Windows). Try:

npm cache clear and re-do npm install

@JeffreyWay

This is pretty cool but I worry that it's another complexity/wrapper onto of gulp to worry about for little gain -- Gulp and grunt files really aren't that difficult to setup, they are so minimal that the argument that it's "easier" isn't really that valid. Also the linear nature of having one build file where you can see all your build steps, exact paths and configuration in one file is incredibly valuable, particularly when your working on a project you don't know much about. The only thing that I can completely see the benefit in having is the event/route scanner, or anything that is Laravel-specific, but to me that should have just been a gulp/grunt plugin that you can use in whatever build tool you like.

Though I'm willing to give it a go (even though I'm not a fan of Gulp but meh). One thing that makes Elixir unusable (for me at the moment) is that during development it would be incredibly slow to use. I don't like my build process to take any longer than 500ms when constantly updating JS, Less files etc. But it will with Exliar because by default it seems to be minifying and uglyfying your css/js, which massively increases the build time. It would be good to have a dev/debug.

Also it would be good to document how to set custom options to pass e.g. to your less task (if that's even possible?)

4 likes
JeffreyWay's avatar

Gulp and grunt files really aren't that difficult to setup, they are so minimal that the argument that it's "easier" isn't really that valid.

Yes it is. Even if it takes you 10 minutes to manually setup a Gulpfile for a new project, well, we just saved you 9:45.

Also the linear nature of having one build file where you can see all your build steps, exact paths and configuration in one file is incredibly valuable.

Why can't you see your build steps and file paths with this approach?

It would be good to have a dev/debug.

We will.

Also it would be good to document how to set custom options to pass e.g. to your less task (if that's even possible?)

Documentation, of course, is coming soon.

2 likes
laloutre's avatar

Well, I think that environment dependant config is very important, and will be included in this tool, to allow quick processes in dev case.

JeffreyWay's avatar

Okay - minification is disabled by default now. That'll speed it up for big projects. For building/production, do:

gulp --production
3 likes
danalloway's avatar

quick questions about using SASS with Elixir. I've searched the codebase, and looked at all the examples, but how does one pass in additional arguments to the gulp-sass plugin through Elixir?

I'd like to use the includePaths option, but I'm unsure how to do this with Elixir.

2 likes
Michgeek's avatar

I worked on my gulpfile for 2 weekend and just discover that awesome Elixir ! I can now focus on my code rather than dealing with gulp.

Are you planning to add support for sourcemaps ?

1 like
christophrumpel's avatar

A great new feature. Especially for Gulp beginners, because it is so damn easy to start! In my case we have worked on our Gulp setup the last half year and I guess there is a reason why it is that long. (At least less than with Grunt :-) ) What will be interesting for me is how it is possible to include a already given Gulp setup. It would be great to use my setup with the other nice Elixir features like including PHPUnit etc. But probably this will be much clearer when the documentations are finished.

Thx Jeffrey, looking forwarding using this new feature!

jhaoda's avatar

Hi all. Have a problem with slashes on Windows:

Run Gulpfile.js

elixir(function(mix) {
  mix.sass('application.scss', 'public/assets/css')
    .styles([
      'assets/css/application.css',
      'assets/css/test.css'
    ], null, 'public/assets/css/application.min.css')
    .scripts([
      'assets/js/application.js',
      'asssets/js/test.js'
    ], null, 'public/assets/js/application.min.js')
    .version(['assets/css/application.min.css', 'assets/js/application.js']);
});

and got rev-manifest.json

{
  "assets\\css\\application.min.css": "assets\\css\\application.min-392557d5.css",
  "assets\\js\\application.js": "assets\\js\\application-cf9dbadd.js"
}

And elixir function not work, of course. Should not the elixir function to convert the backslash to forward slash?

xuma's avatar

Im getting

 Error: source string:1: error: invalid top-level expression

error but when i changed elixir sass.js file from;

.pipe(sass({ outputStyle: config.production ? 'compressed' : 'nested'}))

to

.pipe(sass({ outputStyle: config.production ? 'compressed' : 'nested',sourceComments: 'normal' }))

it working but as expected with comments like ;

/* line 1, /home/xxxx/Work/Projects/laravel5/resources/assets/sass/main.sass */

Anyone have same problem like that ?

landjea's avatar

I saw the explosion of jack-assery on reddit/php when this was announced so I didn't want to post there and get caught in the muck.

tl;dr - Make Elixir a first party add-on like Socialite, not core.

I am a bit confused on the reasoning behind Elixir eing made core. As far as I can tell, from the benefits/magic/functions it provides, Elixir should not be made a part of Laravel's core and I strongly hope for it to be stripped out before November's release of 5.

This doesn't mean I don't like it or won't use it. Elixir seems to be a great and useful product, for those of us that use/understand the underlying tools, but Elixir should definitely be a first-party add on like Socialite. There is no basis for making Elixir an out-of-the-box feature of Laravel when they are stripping out some essential elements (Illuminate\Html).

Laravel itself is already struggling with the belief of a steep learning curve for "newish" developers and adding in the complexities (and learning curves) of Node/Gulp (if something "fails" that new users are blindly installing/using) on top of that will do nothing to remedy the situation. The "Illuminate\HTML" package was stripped, from what I read, because of mass amounts of maintenance required, and I would guess that the mass majority of users will need that package. Imagine the maintenance headaches when "new" users start using Elixir and it starts failing and the new users have no idea if it is Laravel or Node or Gulp causing the problem. First stop will be Laravel forums/IRC/whichever and that will be taking time away to troubleshoot whether or not the user has a Laravel issue or a 3rd party issue.

"Basic->Intermediate" websites are more likely to have forms/"interaction" which necessitate the Illuminate\Html package far more often the requirement of Node.js. Also some developers prefer a nice clean core without the bloat of "optional nice-to-have" features creeping in unnecessarily.

Thanks.

I hope this doesn't come across wrong. Meant with best intentions, but I couldn't find any other thread addressing this concern.

landjea's avatar

...and of course not five minutes after finally posting my worry, I find that Elixir has been pulled and made into an NPM.

facepalm

Sorry for wasting anyone's time.

sebastiansulinski's avatar

I have the same problem - I'm running the vm on Mac OS X 10.9.5 with the same error saying

gulp-notify: [Error running notifier] Could not send message: not found: notify-send

Anyone has managed to resolve the issue yet?

yajra's avatar

Does anyone here know how to change elixir version output path? By default, the output goes to public\build\css\all-xxxx.css and I wanted it to be published to public\css\all-xxxx.css. Having some issue on css path specifically on images where path is relative to css file like below:

Not Found: http://laravel.dev/build/images/sort_desc.png
chaospower's avatar

@yajra one way for this is via gulp.

// http://stackoverflow.com/questions/21546931/use-gulp-to-select-and-move-directories-and-their-files
var gulp = require('gulp'),
    gutil = require('gulp-util'),
    clean = require('gulp-clean');
var filesToMove = [
        './_locales/**/*.*',
        './icons/**/*.*',
        './src/page_action/**/*.*',
        './manifest.json'
];
gulp.task('clean', function(){
  return gulp.src(['dist/*'], {read:false})
  .pipe(clean());
});
gulp.task('move',['clean'], function(){
  // the base option sets the relative root for the set of files,
  // preserving the folder structure
  gulp.src(filesToMove, { base: './' })
  .pipe(gulp.dest('dist'));
});

http://laravel.com/docs/5.0/elixir#extensions

elixir.extend("move", function(move) {

    gulp.task('clean', function(){
            return gulp.src(['dist/*'], {read:false})
            .pipe(clean());
    });

    gulp.task('move',['clean'], function(){
      // the base option sets the relative root for the set of files,
      // preserving the folder structure
      gulp.src(filesToMove, { base: './' })
      .pipe(gulp.dest('dist'));
    });

    return this.queueTask("move");
});

clean = require('gulp-clean'); // is deprecated use del module instead.
yajra's avatar

@chaospower thanks but your solution above may not work since elixir is taking the public\build path as it's base directory on locating the revisions.

Anyways, I solved my problem by just copying the images folder into build directory via mix.copy function.

mix.copy("public/images/", "public/build/images/");
2 likes
zachleigh's avatar

Did anybody ever find a solution to the "gulp-notify: [Error in notifier] Error in plugin 'gulp-notify' not found: notify-send" problem? Im using Linux, not in a VM.

chaospower's avatar

@zachleigh I did sudo npm install -g inside the laravel folder.

I think it was mentioned at previous pages.

bashy's avatar

Shouldn't use sudo, make sure you have .npm or a npm folder set as the prefix. Sudo messes permissions up.

npm config set prefix ~/npm

// add $HOME/npm/bin to $PATH
// append to .bashrc, .zshrc or similar
Previous

Please or to participate in this conversation.