首页 > 解决方案 > Gulp Fontello 使用 adm-zip 出错,最近的现象

问题描述

我在 gulp 构建脚本中使用 gulp-fontello。它已经工作了很多年,直到最近我在运行 fontello 任务时遇到了这个错误:

Error: Invalid filename
    at new module.exports (F:\Websites\olivebranch\wp-content\themes\wpx\assets\node_modules\adm-zip\adm-zip.js:22:10)
    at processResponse (F:\Websites\olivebranch\wp-content\themes\wpx\assets\node_modules\gulp-fontello\lib\index.js:37:15)
    at F:\Websites\olivebranch\wp-content\themes\wpx\assets\node_modules\gulp-fontello\lib\index.js:88:11
    at done (F:\Websites\olivebranch\wp-content\themes\wpx\assets\node_modules\needle\lib\needle.js:460:14)
    at PassThrough.<anonymous> (F:\Websites\olivebranch\wp-content\themes\wpx\assets\node_modules\needle\lib\needle.js:711:9)
    at PassThrough.emit (events.js:182:13)
    at PassThrough.EventEmitter.emit (domain.js:459:23)
    at endReadableNT (_stream_readable.js:1094:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
[11:22:12] 'fontello' errored after 592 ms

我有几十个不同的安装使用这个任务。起初我认为节点发生了一些变化(也许是新版本的 adm-zip?),但事实证明我所有的旧安装也都失败了。在过去几周内未运行 npm install 的较旧安装:

 Error: Invalid filename
    at formatError (C:\Users\Daniel Quinn\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\versioned\^4.0.0\format-error.js:20:10)
    at Gulp.<anonymous> (C:\Users\Daniel Quinn\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\versioned\^4.0.0\log\events.js:31:15)
    at Gulp.emit (events.js:187:15)
    at Gulp.EventEmitter.emit (domain.js:441:20)
    at Object.error (F:\Websites\osrplus\wp-content\themes\corscova\assets\node_modules\undertaker\lib\helpers\createExtensions.js:61:10)
    at handler (F:\Websites\osrplus\wp-content\themes\corscova\assets\node_modules\now-and-later\lib\mapSeries.js:47:14)
    at f (F:\Websites\osrplus\wp-content\themes\corscova\assets\node_modules\once\once.js:25:25)
    at f (F:\Websites\osrplus\wp-content\themes\corscova\assets\node_modules\once\once.js:25:25)
    at tryCatch (F:\Websites\osrplus\wp-content\themes\corscova\assets\node_modules\async-done\index.js:24:15)
    at done (F:\Websites\osrplus\wp-content\themes\corscova\assets\node_modules\async-done\index.js:40:12)

Fontello 内部的文件名似乎发生了变化?

标签: node.jsnpmgulpfontello

解决方案


尝试升级 gulp-fontello 版本 0.5.2。

或将此添加到您的 package.json

"gulp-fontello": "^0.5.2",

推荐阅读