我知道 jpegtran 的 ENOENT 错误被问了很多,我在 Internet 上看到了很多解决方案,但没有一个对我有用......
这是我在 Bamboo 上运行 webpack 任务时遇到的错误:
ERROR in ./client/assets/img/login_bg.jpg
Module build failed: Error: spawn /app/bamboo-data/xml-data/build-dir/JOB1/src/main/fed_webapp/node_modules/jpegtran-bin/vendor/jpegtran ENOENT
at exports._errnoException (util.js:1026:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
@ ./~/css-loader!./~/stylus-loader?resolve url!./client/app/components/auth/auth.styl 6:57-100
[19:31:48] Finished 'webpack' after 49 s
我尝试了各种解决方案,但没有一个对我有用。我正在考虑删除 jpeg 压缩功能,但我不确定如何正确执行此操作...
下面是我的 package.json 和加载器列表的示例:
Webpack 加载器
loaders: [
{test: /\.js$/, exclude: [/app\/lib/, /node_modules/], loader: 'ng-annotate!babel'},
{test: /\.html$/, loader: 'raw'},
{test: /\.styl$/, loader: 'style!css!stylus?resolve url'},
{test: /\.css$/, loader: 'style!css?resolve url'},
{test: /\.(jpe?g|png|gif|svg)$/i, loaders: ['file?hash=sha512&digest=hex&name=assets/[hash].[ext]', 'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false']},
{test: /\.(eot|woff|woff2|ttf)$/, loader: 'url-loader?limit=30000&name=assets/font/[name].[ext]'}
]
包.json
"css-loader": "^0.19.0",
"html-webpack-plugin": "^1.7.0",
"image-webpack-loader": "^2.0.0",
"imagemin": "^5.2.2",
"imagemin-jpegtran": "^5.0.0",
"imagemin-webp": "^4.0.0",
"jpegtran-bin": "^3.2.0",
欢迎任何帮助,谢谢