Всем привет.
Прошу помощи разобраться с ошибкой.
С Gulp познакомился недавно, по видео настроил под себя, всё работало до сегодняшнего утра.
Вот сама ошибка:events.js:183
throw er; // Unhandled 'error' event
^
SyntaxError: Unterminated string constant (12:44)
at Parser.pp$4.raise (C:\Users\shakhrom\Desktop\Inweex\node_modules\acorn-globals\node_modules\acorn\dist\acorn.js:2488:13)
at Parser.pp$7.readString (C:\Users\shakhrom\Desktop\Inweex\node_modules\acorn-globals\node_modules\acorn\dist\acorn.js:3195:33)
at Parser.pp$7.getTokenFromCode (C:\Users\shakhrom\Desktop\Inweex\node_modules\acorn-globals\node_modules\acorn\dist\acorn.js:2980:17)
at Parser.pp$7.readToken (C:\Users\shakhrom\Desktop\Inweex\node_modules\acorn-globals\node_modules\acorn\dist\acorn.js:2733:15)
at Parser.pp$7.nextToken (C:\Users\shakhrom\Desktop\Inweex\node_modules\acorn-globals\node_modules\acorn\dist\acorn.js:2724:13)
at Parser.pp$7.next (C:\Users\shakhrom\Desktop\Inweex\node_modules\acorn-globals\node_modules\acorn\dist\acorn.js:2684:8)
at Parser.pp$3.parseLiteral (C:\Users\shakhrom\Desktop\Inweex\node_modules\acorn-globals\node_modules\acorn\dist\acorn.js:2019:8)
at Parser.pp$3.parseExprAtom (C:\Users\shakhrom\Desktop\Inweex\node_modules\acorn-globals\node_modules\acorn\dist\acorn.js:1968:17)
at Parser.pp$3.parseExprSubscripts (C:\Users\shakhrom\Desktop\Inweex\node_modules\acorn-globals\node_modules\acorn\dist\acorn.js:1872:19)
at Parser.pp$3.parseMaybeUnary (C:\Users\shakhrom\Desktop\Inweex\node_modules\acorn-globals\node_modules\acorn\dist\acorn.js:1849:17)
А вот что в файле gulpfile.js
var syntax = 'sass'; // Syntax: sass or scss;
var
gulp = require('gulp'),
browserSync = require('browser-sync'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
cleancss = require('gulp-clean-css'),
groupmedia = require('gulp-group-css-media-queries'),
rename = require('gulp-rename'),
del = require('del'),
imagemin = require('gulp-imagemin'),
pngquant = require('imagemin-pngquant'),
cache = require('gulp-cache'),
autoprefixer = require('gulp-autoprefixer'),
notify = require("gulp-notify");
pug = require('gulp-pug' ),
gulp.task('browser-sync', function() {
browserSync({
server: {
baseDir: 'app'
},
notify: false,
// open: false,
// online: false, // Work Offline Without Internet Connection
// tunnel: true, tunnel: "demo", // Demonstration page: http://projectname.localtunnel.me
})
});
gulp.task('pug', function buildHTML() {
return gulp.src('app/pug/pages/*.pug')
.pipe(pug({
pretty: true
}))
.pipe(gulp.dest('app'))
});
gulp.task('styles', function() {
return gulp.src('app/'+syntax+'/**/*.'+syntax+'')
.pipe(sass({ outputStyle: 'expanded' }).on("error", notify.onError()))
.pipe(rename({ suffix: '.min', prefix : '' }))
.pipe(autoprefixer(['last 15 versions']))
.pipe(groupmedia())
.pipe(cleancss()) // Opt., comment out when debugging
.pipe(gulp.dest('app/css'))
.pipe(browserSync.reload({stream: true}))
});
gulp.task('js', function() {
return gulp.src([
'app/libs/jquery/jquery.min.js',
'app/js/common.js', // Always at the end
])
.pipe(concat('scripts.min.js'))
// .pipe(uglify()) // Minify js (opt.)
.pipe(gulp.dest('app/js'))
.pipe(browserSync.reload({ stream: true }))
});
gulp.task('imagemin', function() {
return gulp.src('app/img/**/*')
.pipe(cache(imagemin({
interlaced: true,
progressive: true,
svgoPlugins: [{removeViewBox: false}],
use: [pngquant()]
})))
.pipe(gulp.dest('dist/img'));
});
gulp.task('build', ['removedist', 'imagemin', 'styles', 'js'], function() {
var buildFiles = gulp.src([
'app/*.html',
'app/*.php',
'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('watch', ['pug', 'styles', 'js', 'browser-sync'], function() {
gulp.watch('app/'+syntax+'/**/*.'+syntax+'', ['styles']);
gulp.watch('app/pug/**/*.pug', ['pug']);
gulp.watch(['libs/**/*.js', 'app/js/common.js'], ['js']);
gulp.watch('app/*.html', browserSync.reload)
});
gulp.task('removedist', function() { return del.sync('dist'); });
gulp.task('clearcache', function () { return cache.clearAll(); });
gulp.task('default', ['watch']);
Ошибка выходит при
watch, а при
gulp build нет ошибок.
Уже удалял полностью node.js, чистил все связанные директории.
- Node v8.12.0
- Gulp v3.9.1
- NPM v6.4.1