gpt4 book ai didi

node.js - grunt-contrig-imagemin 警告 : Cannot call method 'replace' of undefined

转载 作者:搜寻专家 更新时间:2023-10-31 22:57:44 24 4
gpt4 key购买 nike

我在尝试使用 imagemin 时收到奇怪的警告,但没有任何反应。

grunt imagemin:primary

Warning: Cannot call method 'replace' of undefined Used --force, continuing.
Done, but with warnings.

给我错误的任务如下

  grunt.config 'imagemin'

primary:
options:
optimizationLevel: 7
expand: true
cwd: "assets"
src: "{img,img_two}/**/*.{jpg,jpeg,gif,png}"
dest: "public/compiled/img"


grunt.loadNpmTasks 'grunt-contrib-imagemin'

这些都行不通

src: "img/**/*.{jpg,jpeg,gif,png}"

src: "{img,img_two}/**/*.{jpg,jpeg,gif,png}"

这些工作

src: "img/**/*.jpg"

src: "{img,img_two}/**/*.jpg"

所以它似乎不喜欢多扩展语法,但为什么,它甚至是如何在示例中完成的?

更新:似乎只有 PNG 不起作用,无论我是自己进行扩展还是在组匹配中进行扩展。我在 Windows 8 上,NPM 1.4.3

https://github.com/gruntjs/grunt-contrib-imagemin/issues/219

最佳答案

有同样的问题,我通过删除位于 node_modules 中的 grunt-contrib-imagemin 目录修复了它

然后我运行“npm install grunt-contrib-imagemin”来获取最新版本。

关于node.js - grunt-contrig-imagemin 警告 : Cannot call method 'replace' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23705680/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com