gulp

Error: spawn ENOENT: missing the sass executable

时光总嘲笑我的痴心妄想 提交于 2019-12-03 13:10:32
I'm using bash in windows. Getting this error when trying to run a sass compiler command via gulp. I have Ruby & Sass installed. Sass works fine when running it manually. Error: spawn ENOENT: missing the sass executable. Please install sass and make available on your PATH I have included the directory of my ruby bin in the PATH var (system variables within Enviroment variables). Anyone got any ideas? Your gulp-ruby-sass task is probably configured to execute SASS using Bundler (a gem dependency manager). When you don't have Bundler installed, that execution will fail with the error message you

Gulp-watch is not picking up new files

狂风中的少年 提交于 2019-12-03 12:39:33
I'm trying to run a task whenever a file get's changed, delete or a new file is added. The first two work, however: when a new file is added it's not being picked up. I installed the package gulp-watch and I have this task: var gulp = require('gulp'), watch = require('gulp-watch'); gulp.task('watch', function() { watch( ['./src/Scripts/**/*.js'], function(ev, cb) { console.log('test'); cb(); }); }); That was a weird problem. Removing ./ from glob fixes it. var gulp = require('gulp'); var watch = require('gulp-watch'); gulp.task('watch', function() { watch(['src/Scripts/**/*.js'], function

gulp-mocha how to pass the compilers flag?

对着背影说爱祢 提交于 2019-12-03 12:38:45
I'm trying to use the gulp-mocha module but can't figure out a good way to pass over the compilers flag. Is there a way to include this in my gulp task? Maybe in a separate pipe somehow? Example if running mocha from command line (works fine) mocha --compilers .:my_compiler.js test/**/*.js Example if using gulp-mocha (but where can I specify a compiler)? gulp.task('test', function () { gulp.src(["test/**/*.js"], { read: false }) .pipe(mocha({ reporter: 'spec' })) .pipe(exit()); }); I don't see a compilers option under the gulp-mocha plugin, so I'm thinking I need to somehow add the compilers

Error handling with gulp-notify and gulp-plumber

佐手、 提交于 2019-12-03 12:26:00
I want to display a notification when: 1. An error occurs 2. When the script was successfully executed All notifications are actually working but the success notification is always displayed, even when there is an error. How can I make sure the success notification is only displayed when no errors have occurred? This is my current task: var gulp = require('gulp'); var sass = require('gulp-ruby-sass'); var rename = require('gulp-rename'); var notify = require('gulp-notify'); var plumber = require('gulp-plumber'); var minifycss = require('gulp-minify-css'); var autoprefixer = require('gulp

How to fix “Task is not in your gulpfile” error when using npm link?

泪湿孤枕 提交于 2019-12-03 12:19:11
We have a bunch of applications sharing common gulp logic, so we made a gulp plugin that contains a bunch of custom tasks. However we'd like to avoid installing gulp+our plugin (along with half the internet) for each of the applications we develop. Ideally, I'd like to do: npm install -g gulp npm install -g <our gulp plugin> Then for each app, we'd simply have to do: npm link gulp npm link <our gulp plugin> Although this works, the problem is gulp no longer recognizes any of our custom gulp tasks. Any gulp command I run results in: [15:16:51] Using gulpfile /workspace/my-app/gulpfile.js [15:16

Browser-sync TypeError args.cb is not a function

你说的曾经没有我的故事 提交于 2019-12-03 12:17:32
I'm using browser-sync in gulp task for example : gulp.task('gulp-task',function(){ browserSync.init({ server:{ baseDir: 'app' } }) //rest of task }); I use this gulp task in gulp watch for( for example ) app/**/*.html like : gulp.task('watch',function(){ gulp.watch('app/**/*.html', ['gulp-task']); }); for first time change in html files everything is ok but for next changes i get error: TypeError: args.cbn is not a function ... guys said to install latest version for browser-sync with command below : npm install browser-sync@latest --save-dev and it doesn't helped. I'm getting the same error.

Gulp-sass fails to compile scss file

谁都会走 提交于 2019-12-03 12:02:55
问题 I'm using Gulp to compile my sass into css. A simple task compiles the style.scss file in the _/sass directory and saves the output into the root of the project. style.scss is used merely to import other files in the _/sass directory. When I run the default task from the command line ( $ gulp ) I get an error that the sass can't compile. It is included below in full. I have removed all content from the included files and run the task again. I still receive the same error (something I read

Any equivalent gulp plugin for doing “grunt bower”?

痴心易碎 提交于 2019-12-03 11:55:51
With grunt , I could use command grunt bower (provided by grunt-bower-requirejs ) to auto-generate RequireJS config file for my local bower components. Is there any plugin for gulp to perform similar task? Mind that bowerRequireJS is an asynchronous function. So you would need to use a callback (or synchronously return a Promise) to mark that task as asynchronous like so: gulp.task('bower', function(callback) { var options = { baseUrl: 'src', config: 'src/app/require.config.js', transitive: true }; bowerRequireJS(options, function (rjsConfigFromBower) { callback(); }); }); UPDATE: for future

What is the purpose(s) of JavaScript build tools

百般思念 提交于 2019-12-03 11:25:44
Lately I have been studying Node.js. In this time,I have heard a lot about using Gulp or Grunt in as a build tool. Now I am interested in learning how to use Gulp. I have heard it was a build tool, but I am not sure what all that covers. What would I do(what kind of tasks) with a build tool like Gulp that would assist me in development? Some examples would be nice. Gulp ( and Grunt ) allows for task automation. Pretty much anything you find yourself doing repeatedly in a project, can be automated with gulp and it's plugins. and if you can't find a plugin to do the job for you, gulp is just a

How can I debug Gulp tasks using Node Tools for Visual Studio?

不问归期 提交于 2019-12-03 11:07:07
I recently installed NodeJS Tools for Visual Studio which touts support for Node environments in VS. Notably, it has the ability to set debug breakpoints from the IDE. It's unclear to me if it is possible to set breakpoints when debugging Gulp tasks. The Task Runner has the ability to detect the Gulp task and output console.log statements to a window, but I haven't found a better means of debugging. I found this post from a while back: How can I debug gulpfile.js when running it with Visual Studio Task Runner Explorer? However, this post doesn't involve NodeJS Tools for VS. So, I'm re-asking