TypeError: imagemin.jpegtran is not a function

1 错误

[22:39:01] Using gulpfile G:\codeFolder\hexo-blog\lizhi\gulpfile.js
[22:39:01] Starting 'default'...
[22:39:01] Starting 'minify-html'...
[22:39:01] Starting 'minify-css'...
[22:39:01] Starting 'minify-js'...
[22:39:01] Starting 'minify-images'...
[22:39:02] 'minify-images' errored after 86 ms
[22:39:02] TypeError: imagemin.jpegtran is not a function
    at G:\codeFolder\hexo-blog\lizhi\gulpfile.js:60:22
    at minify-images (G:\codeFolder\hexo-blog\lizhi\node_modules\undertaker\lib\set-task.js:13:15)
    at bound (domain.js:419:14)
    at runBound (domain.js:432:12)
    at asyncRunner (G:\codeFolder\hexo-blog\lizhi\node_modules\async-done\index.js:55:18)
    at processTicksAndRejections (internal/process/task_queues.js:75:11)
[22:39:02] 'default' errored after 90 ms
[22:39:02] The following tasks did not complete: minify-html, minify-css, minify-js
[22:39:02] Did you forget to signal async completion?

2 解决方案

github答案
Had the same problem. The issue is you’re still calling imagemin.jpegtran in your config, which was replaced by imagemin.mozjpeg in v7.0.0.

// old
imagemin.jpegtran({
progressive: true,
}),

// new
imagemin.mozjpeg({
progressive: true,
}),
See also: 279a91b#diff-0730bb7c2e8f9ea2438b52e419dd86c9R36

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值