при выполнении команды gulp watch выдает такое
PS D:\templates\bitlex> gulp watch
fs.js:25
'use strict';
^
ReferenceError: internalBinding is not defined
at fs.js:25:1
at req_ (D:\templates\bitlex\node_modules\natives\index.js:137:5)
at Object.req [as require] (D:\templates\bitlex\node_modules\natives\index.js:54:10)
at Object.<anonymous> (D:\templates\bitlex\node_modules\graceful-fs\fs.js:1:37)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Module.require (internal/modules/cjs/loader.js:723:19)
at require (internal/modules/cjs/helpers.js:14:16)
PS D:\templates\bitlex>
файл package.json
{
"name": "cdm",
"version": "1.0.0",
"description": "cdm project",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "litesite",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.23.7",
"del": "^3.0.0",
"gulp": "^4.0.1",
"gulp-autoprefixer": "^5.0.0",
"gulp-cache": "^1.0.2",
"gulp-concat": "^2.6.1",
"gulp-cssnano": "^2.1.3",
"gulp-imagemin": "^4.1.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^4.0.1",
"gulp-uglifyjs": "^0.6.2",
"imagemin-pngquant": "^5.1.0"
},
"dependencies": {
"graceful-fs": "^4.2.3",
"gulp-cli": "^2.2.0",
"minimatch": "^3.0.4",
"natives": "^1.1.6",
"npm": "^6.12.1"
}
}
файл gulpfile.js
var gulp = require('gulp'),
sass = require('gulp-sass'),
browserSync = require('browser-sync'),
concat = require('gulp-concat'),
uglify = require('gulp-uglifyjs'),
cssnano = require('gulp-cssnano'),
rename = require('gulp-rename'),
del = require('del'),
imagemin = require('gulp-imagemin'),
pngquant = require('imagemin-pngquant'),
cache = require('gulp-cache'),
autoprefixer = require('gulp-autoprefixer');
gulp.task('sass', function(){
return gulp.src('app/sass/**/*.scss')
.pipe(sass())
.pipe(autoprefixer(['last 15 versions', '> 1%', 'ie 8', 'ie 7'], {cascade: true}))
.pipe(gulp.dest('app/css'))
.pipe(browserSync.reload({stream: true}))
});
gulp.task('browser-sync', function(){
browserSync({
server: {
baseDir: 'app'
},
});
});
gulp.task('scripts', function(){
return gulp.src([
'app/libs/jquery/dist/jquery.min.js'
])
.pipe(concat('libs.min.js'))
.pipe(uglify())
.pipe(gulp.dest('app/js'));
});
gulp.task('css-libs', ['sass'], function(){
return gulp.src('app/css/libs.css')
.pipe(cssnano())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('app/css'))
});
gulp.task('clean', function(){
return del.sync('dist');
});
gulp.task('clear', function(){
return cache.clearAll();
});
gulp.task('img', function(){
return gulp.src('app/img/**/*')
.pipe(cache(imagemin({
interlaced: true,
progressive: true,
svgoPlugins: [{removeViewBox: false}],
une: [pngquant()]
})))
.pipe(gulp.dest('dist/img'));
});
gulp.task('watch', ['browser-sync', 'css-libs', 'scripts'], function(){
gulp.watch('app/sass/**/*.scss', ['sass']);
gulp.watch('app/*.html', browserSync.reload);
gulp.watch('app/js/*.js', browserSync.reload);
});
gulp.task('build', ['clean', 'img', 'sass', 'scripts'], function(){
var buildCss = gulp.src([
'app/css/style.css',
'app/css/libs.min.css',
])
.pipe(gulp.dest('dist/css'));
var buildFonts = gulp.src('app/fonts/**/*')
.pipe(gulp.dest('dist/fonts'));
var buildJs = gulp.src('app/js/**/*')
.pipe(gulp.dest('dist/js'));
var buildHtml = gulp.src('app/*.html')
.pipe(gulp.dest('dist'));
});
Айфон мало держит заряд, разбираемся с проблемой вместе с AppLab
Подскажите оптимальный способ для реализации событий на C++Нужно реализовать подписку на события, с возможностью передачи аргументов
У меня есть класс BinTree, описывающий бинарное дерево поиска: