2014-10-23 6 views
6

interessa errori di allocazione di memoria come sto ottenendo con sorso, a prescindere heres l'uscita dell'errore:sto ottenendo gli errori malloc con gulp

gulp compile:development 
[15:33:51] Warning: gulp version mismatch: 
[15:33:51] Global gulp is 3.8.7 
[15:33:51] Local gulp is 3.8.6 
[15:33:52] Using gulpfile ~/Dropbox/AisisGit/Zen/gulpfile.js 
[15:33:52] Starting 'bower'... 
[15:33:52] Using cwd: ./ 
[15:33:52] Using bower dir: ./bower_components 
[15:33:52] Starting 'compile:jsx'... 
[15:33:52] Starting 'compile:js:development'... 
[15:33:52] Starting 'compile:sass:development'... 
[15:33:52] Starting 'serve'... 
[15:33:52] Finished 'serve' after 1.88 ms 
[15:33:52] Server started on 9010 port 
[15:33:52] Finished 'compile:jsx' after 376 ms 
[15:33:52] Finished 'compile:js:development' after 371 ms 
[15:33:52] Starting 'watch:compilejs'... 
[15:33:52] Finished 'watch:compilejs' after 6.4 μs 
gulp(97412,0x7fff7ba57300) malloc: *** error for object 0x10598e5a9: pointer being freed was not allocated 
*** set a breakpoint in malloc_error_break to debug 
Abort trap: 6 

Vediamo ora il fiato il file è di per sé.

var gulp = require('gulp'); 
var bower = require('gulp-bower'); 
var serve = require('gulp-serve'); 
var concat = require('gulp-concat'); 
var sass = require('gulp-sass'); 
var ugly = require('gulp-uglify'); 
var minifyCss = require('gulp-minify-css'); 
var livereload = require('gulp-livereload'); 
var watch = require('gulp-watch'); 
var react = require('gulp-react'); 

gulp.task('default', function() {}); 

gulp.task('compile:production', 
    [ 
    'bower', 
    'compile:jsx', 
    'compile:js', 
    'compile:sass', 
    ] 
); 

gulp.task('compile:development', 
    [ 
    'bower', 
    'compile:jsx', 
    'compile:js:development', 
    'compile:sass:development', 
    'serve', 
    'watch' 
    ] 
); 

gulp.task('watch:compilejs', 
    [ 
    'compile:jsx', 
    'compile:js:development', 
    ] 
); 

gulp.task('watch:compilecss', 
    [ 
    'compile:sass:development' 
    ] 
); 

gulp.task('compile:sass', function() { 
    return gulp.src([ 
    'src/css/*.scss' 
    ]).pipe(concat('style.scss')) 
    .pipe(sass()) 
    .pipe(minifyCss()) 
    .pipe(gulp.dest('dist/css/')) 
}); 

gulp.task('compile:sass:development', function() { 
    return gulp.src([ 
    'src/css/*.scss' 
    ]).pipe(concat('style.css')) 
    .pipe(sass()) 
    .pipe(gulp.dest('compiled/css/')) 
}); 

gulp.task('compile:jsx', function() { 
    return gulp.src([ 
    'src/js/**/*.jsx', 
    ]).pipe(react()) 
    .pipe(gulp.dest('src/react-compiled/')) 
}); 

gulp.task('compile:js', function() { 

    return gulp.src([ 
    'src/js/**/*.js', 
    'src/react-compiled/**/*.js' 
    ]).pipe(concat('dist.js')) 
    .pipe(ugly()) 
    .pipe(gulp.dest('dist/js/')); 

}); 

gulp.task('compile:js:development', function() { 

    return gulp.src([ 
    'src/js/**/*.js', 
    'src/react-compiled/**/*.js' 
    ]).pipe(concat('dist.js')) 
    .pipe(gulp.dest('dist/js/')); 

}); 

gulp.task('watch', ['watch:compilejs', 'watch:compilecss'], function() { 
    var server = livereload(); 
    gulp.watch('src/js/**/*.js', ['watch:compilejs']); 
    gulp.watch('src/js/**/*.js.jsx', ['watch:compilejs']); 
    gulp.watch('src/css/**/*.scss', ['watch:compilecss']); 
    gulp.watch('compiled/**').on('change', function(file) { 
    server.changed(file.path); 
    }); 
}); 

gulp.task('bower', function() { 
    return bower({dir: './bower-components', cwd: './'}); 
}); 

gulp.task('serve', serve({ 
    root: 'compiled/', 
    port: 9010, 
})); 

Così chiaramente sto neanche a fare qualche epicamente sbagliato per ottenere gli errori di allocazione Mem o c'è qualcosa di sbagliato a livello molto maggiore. Io uso un file gulp simile per un altro progetto - l'unica differenza è che l'altro ha immagini in movimento e file di font.

In ogni caso, c'è qualcosa di sbagliato nel mio file gulp o c'è qualcosa di molto più grande qui?

+1

Recentemente ho aggiornato a Yosemite e ho iniziato a vedere lo stesso errore; il tuo sistema operativo è cambiato di recente? – thure

risposta

2

Penso che potrebbe essere necessario ricostruire i moduli.

Stavo vedendo un errore molto simile dopo l'aggiornamento a OS X Yosemite, anche se il mio problema era con gulp-sass.

L'eliminazione node_modules e in esecuzione npm install ha risolto nuovamente il problema per me.

22

Sono venuto a questo sito con lo stesso problema. Ho provato a disinstallare/reinstallare e non ha funzionato.

ho trovato questo problema sulla loro pagina Github: https://github.com/dlmanning/gulp-sass/issues/104

E sembra che potrebbe essere un problema con il plugin gulp-sass e un file vuoti. Prova ad aggiungere una riga nel file .scss e dovresti impostarla. Ha funzionato per me.

+3

L'aggiunta di un commento risolve anche il problema. Se non hai ancora nulla di utile da mettere lì dentro. –

+0

Questo era il problema anche per me, un file scss vuoto. – superluminary

+0

Grazie! Non l'avrei mai trovato da solo. – tolmark