首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Gulp Fontello错误与adm-zip,最近的现象

Gulp Fontello错误与adm-zip,最近的现象
EN

Stack Overflow用户
提问于 2020-10-16 23:33:48
回答 2查看 185关注 0票数 1

我在一个gulp构建脚本中使用了gulp-fontello。它多年来一直运行得很好,直到最近我运行fontello任务时才得到这个错误:

代码语言:javascript
复制
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的旧安装是在过去几周内安装的:

代码语言:javascript
复制
 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内部的文件名已经改变了?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-10-27 10:22:17

如果您在gulp任务中使用host选项检查设置的协议,则它必须是https才能按预期工作

代码语言:javascript
复制
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'))
});

如果您没有使用任何选项,请尝试这样设置主机

代码语言:javascript
复制
return gulp.src('config.json')
    .pipe($.fontello({host: 'https://fontello.com'}))
    .pipe(gulp.dest('dist'));
票数 1
EN

Stack Overflow用户

发布于 2020-10-22 18:27:49

尝试升级gulp fontello版本0.5.2。

或者将其添加到您的package.json中

代码语言:javascript
复制
"gulp-fontello": "^0.5.2",
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64392186

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档