2
이미지가있는 이미지를 축소하려고하는데 오류가 있습니다. 내가 잘못 한 것을 이해하지 못합니다. 여기 이미지 처리 오류가 함수 오류가 아닙니다.
은 당신이 아니다pipe()
뭔가하려고 할 때 일반적으로이 오류가 발생 내 gulpfile
'use strict';
var gulp = require('gulp');
var imagemin = require('imagemin');
var clean = require('gulp-clean');
gulp.task('img', function() {
return gulp.src('src/img/**')
.pipe(imagemin())
.pipe(gulp.dest('build/img'));
});
gulp.task('clean', function() {
console.log('-----------удаляю build');
return gulp.src('build', {read: false})
.pipe(clean());
});
그리고 콘솔
$ gulp img
(node:14312) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[22:10:20] Using gulpfile Z:\a\gulpfile.js
[22:10:20] Starting 'img'...
[22:10:20] 'img' errored after 26 ms
[22:10:20] TypeError: dest.on is not a function
at DestroyableTransform.Readable.pipe (Z:\a\node_modules\vinyl-fs\node_modules\readable-stream\lib\_stream_readable.js:516:8)
at Gulp.<anonymous> (Z:\a\gulpfile.js:9:6)
at module.exports (Z:\a\node_modules\orchestrator\lib\runTask.js:34:7)
at Gulp.Orchestrator._runTask (Z:\a\node_modules\orchestrator\index.js:273:3)
at Gulp.Orchestrator._runStep (Z:\a\node_modules\orchestrator\index.js:214:10)
at Gulp.Orchestrator.start (Z:\a\node_modules\orchestrator\index.js:134:8)
at C:\Users\Artur\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\versioned\^3.7.0\index.js:46:20
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Function.Module.runMain (module.js:577:11)
답변 해 주셔서 감사합니다. 문제는 내가 꿀꺽 꿀꺽 마셨다 고 생각합니다. 4.0 동일한 문제가 위저즈 자동 접두어 였기 때문에 doungrade를 사용하여 3.9.1을 해결했습니다. 꿀꺽 꿀꺽 시도해보고 싶지만 설치에 문제가있어서 작동하지 않습니다. – BigKompot