我在一个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我有几十个不同的安装来使用这个任务。起初,我认为node中发生了一些变化(也许是adm-zip的新版本?)但事实证明,我所有的旧安装也无法完成这项任务。没有运行npm的旧安装是在过去几周内安装的:
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内部的文件名已经改变了?
发布于 2020-10-27 10:22:17
如果您在gulp任务中使用host选项检查设置的协议,则它必须是https才能按预期工作
const gulp = require('gulp'),
$ = require('gulp-load-plugins')();
const options = {
host : 'https://fontello.com',
font : 'font',
css : 'css'
};
gulp.task('fontello', function () {
return gulp.src('config.json')
.pipe($.fontello(options))
.pipe(gulp.dest('dist'))
});如果您没有使用任何选项,请尝试这样设置主机
return gulp.src('config.json')
.pipe($.fontello({host: 'https://fontello.com'}))
.pipe(gulp.dest('dist'));发布于 2020-10-22 18:27:49
尝试升级gulp fontello版本0.5.2。
或者将其添加到您的package.json中
"gulp-fontello": "^0.5.2",https://stackoverflow.com/questions/64392186
复制相似问题