sindresorhus / gulp-autoprefixer

Prefix CSS
MIT License
694 stars 50 forks source link

"TypeError: this is not a typed array", Gulp error, help me #84

Closed richvoronov closed 7 years ago

richvoronov commented 7 years ago

Hello! Day ago I moved to Ubunutu from Windows 10 and only now I started configuring gulp for web development. Faced such a problem when start gulp:

`[15:31:33] Starting 'sass'... [15:31:33] Starting 'common-js'... [15:31:33] Starting 'browser-sync'... [15:31:33] Finished 'browser-sync' after 48 ms [15:31:33] Finished 'common-js' after 92 ms [15:31:33] Starting 'js'...

events.js:141 throw er; // Unhandled 'error' event ^ TypeError: this is not a typed array. at Function.from (native) at /media/richard/HDD/General/web/_dev/gulp.com/node_modules/gulp-autoprefixer/index.js:25:27 at process._tickCallback (node.js:356:9)`

screenshot from 2017-07-09 14-03-53

my gulpfile.js screenshot from 2017-07-09 15-54-44

`var gulp = require('gulp'), gutil = require('gulp-util' ), sass = require('gulp-sass'), browserSync = require('browser-sync'), concat = require('gulp-concat'), uglify = require('gulp-uglify'), cleanCSS = require('gulp-clean-css'), rename = require('gulp-rename'), del = require('del'), imagemin = require('gulp-imagemin'), cache = require('gulp-cache'), autoprefixer = require('gulp-autoprefixer'), ftp = require('vinyl-ftp'), notify = require("gulp-notify");

gulp.task('common-js', function() { return gulp.src([ 'app/js/common.js', ]) .pipe(concat('common.min.js')) .pipe(uglify()) .pipe(gulp.dest('app/js')); });

gulp.task('js', ['common-js'], function() { return gulp.src([ 'app/libs/jquery/dist/jquery.min.js', 'app/js/common.min.js', // Всегда в конце ]) .pipe(concat('scripts.min.js')) .pipe(uglify()) .pipe(gulp.dest('app/js')) .pipe(browserSync.reload({stream: true})); });

gulp.task('browser-sync', function() { browserSync({ proxy: 'http://localhost/app', notify: false, // tunnel: true, // tunnel: "projectmane", }); });

gulp.task('sass', function() { return gulp.src('app/sass/*/.sass') .pipe(sass({outputStyle: 'expand'}).on("error", notify.onError())) .pipe(rename({suffix: '.min', prefix : ''})) .pipe(autoprefixer(['last 15 versions'])) // .pipe(cleanCSS()) .pipe(gulp.dest('app/css')) .pipe(browserSync.reload({stream: true})); });

gulp.task('watch', ['sass', 'js', 'browser-sync'], function() { gulp.watch('app/sass/*/.sass', ['sass']); gulp.watch(['libs/*/.js', 'app/js/common.js'], ['js']); gulp.watch('app/*.php', browserSync.reload); });

gulp.task('imagemin', function() { return gulp.src('app/img/*/') .pipe(cache(imagemin())) .pipe(gulp.dest('dist/img')); });

gulp.task('build', ['removedist', 'imagemin', 'sass', 'js'], function() {

var buildFiles = gulp.src([
    'app/*.html',
    'app/.htaccess',
    ]).pipe(gulp.dest('dist'));

var buildCss = gulp.src([
    'app/css/main.min.css',
    ]).pipe(gulp.dest('dist/css'));

var buildJs = gulp.src([
    'app/js/scripts.min.js',
    ]).pipe(gulp.dest('dist/js'));

var buildFonts = gulp.src([
    'app/fonts/**/*',
    ]).pipe(gulp.dest('dist/fonts'));

});

gulp.task('deploy', function() {

var conn = ftp.create({
    host:      'hostname.com',
    user:      'username',
    password:  'userpassword',
    parallel:  10,
    log: gutil.log
});

var globs = [
'dist/**',
'dist/.htaccess',
];
return gulp.src(globs, {buffer: false})
.pipe(conn.dest('/path/to/folder/on/server'));

});

gulp.task('removedist', function() { return del.sync('dist'); }); gulp.task('clearcache', function () { return cache.clearAll(); });

gulp.task('default', ['watch']); ` it is screen at "/media/richard/HDD/General/web/_dev/gulp.com/node_modules/gulp-autoprefixer/index.js" screenshot from 2017-07-09 14-05-40

Nodejs version 8.1.3 auro-prefixer 4.0.0

How can I solve this problem? thx

kevva commented 7 years ago

Can you log the error?

.on('error', err => {
    console.log(err);
});

It does sound like a node version issue though. Can you verify that you're using 8.1.3? Newer node versions produce a different error message for Buffer.from than the one you provided.

richvoronov commented 7 years ago

Thank you, for answer. But мy problem disappeared after reinstallation Ubutntu. And now it work :)

2017-07-10 12:12 GMT+03:00 Kevin Mårtensson notifications@github.com:

Can you log the error?

.on('error', err => { console.log(err); });

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sindresorhus/gulp-autoprefixer/issues/84#issuecomment-314050454, or mute the thread https://github.com/notifications/unsubscribe-auth/AZayszIhrpBj-pIC12yWNr44_JNRUteSks5sMesJgaJpZM4OSDUZ .

roboriaan commented 7 years ago

Here we go down the rabbit hole

xumix commented 6 years ago

{ [TypeError: this is not a typed array.] name: 'TypeError', message: 'this is not a typed array.', stack: 'TypeError: this is not a typed array.\n at Function.from (native)\n at C:\Projects\Portal2\Src\Site\Eiip.Web\node_modules\gulp-autoprefixer\index.js:25:27\n at process._tickDomainCallback (node.js:444:9)', fileName: 'C:\Projects\Portal2\Src\Site\Eiip.Web\Content\map-widget.css', showStack: true, showProperties: true, plugin: 'gulp-autoprefixer' }

PM> node -v v6.11.5

xumix commented 6 years ago

Ok, here is the answer: https://stackoverflow.com/questions/43849585/update-node-version-in-visual-studio-2017

duzun commented 6 years ago

@xumix just wander, what is in your ‘C:\Projects\Portal2’ folder? :) I’m a fun of Portal2 game

xumix commented 6 years ago

@duzun oooops :) Not a game folder :)