jpegtran error on Bamboo CI build

226 views Asked by At

I know that the ENOENT error with jpegtran has been asked a lot and I saw a lot of solutions on Internet but none of them worked for me...

Here's the error I got when I run my webpack task on Bamboo :

 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

I've tried various solutions but none of them worked for me. I'm thinking of removing the jpeg compression feature but I'm not sure how to do this properly...

Below are a sample of my package.json and my loaders list:


Webpack loaders

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]'}
    ]

package.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",

Any help is welcome, thank you

1

There are 1 answers

0
Carvallegro On BEST ANSWER

Adding all the imagemin and jpegtran dependencies to the package.json actually worked.

I had to clean the node_modules folder to see the changes