ducksoupdev / gulp-site-generator

A static site generator using Gulp
183 stars 29 forks source link

image-min / TypeError: dest.on is not a function #20

Closed ringods closed 8 years ago

ringods commented 8 years ago

Hello,

I am converting a static site with a custom gulpfile.js to your gulp-site-generator setup. I used the subrepo approach. After adding all the dependencies to my package.json, I got this as result on first build:

> gulp

[14:40:58] Using gulpfile /pipeline/source/gulpfile.js
[14:40:58] Starting 'sass'...
[14:40:58] Starting 'copy-fonts'...
[14:40:58] Starting 'copy-css'...
[14:40:58] Starting 'concat-js'...
[14:40:58] Starting 'image-min'...
[14:40:58] 'image-min' errored after 4.26 ms
[14:40:58] TypeError: dest.on is not a function
    at DestroyableTransform.Readable.pipe (/pipeline/source/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:516:8)
    at Gulp.<anonymous> (/pipeline/source/tools/gulp/tasks/image-min.js:16:14)
    at module.exports (/pipeline/source/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/pipeline/source/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/pipeline/source/node_modules/orchestrator/index.js:214:10)
    at Gulp.Orchestrator.start (/pipeline/source/node_modules/orchestrator/index.js:134:8)
    at /pipeline/source/node_modules/gulp/bin/gulp.js:129:20
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    at Module.runMain (module.js:592:11)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
(node:104) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Expected a buffer
[14:40:58] Finished 'copy-fonts' after 29 ms
[14:40:58] Finished 'copy-css' after 29 ms
[14:40:58] Finished 'concat-js' after 27 ms
[14:40:58] Finished 'sass' after 91 ms

Here is my package.json:

{
  "name": "rq-website",
  "version": "2016.08.03",
  "description": "ReleaseQueue Product Website",
  "main": "index.js",
  "author": "Ringo De Smet",
  "license": "Commercial",
  "repository": {
    "type": "git",
    "url": "git@bitbucket.com:releasequeue/rq-website.git"
  },
  "homepage": "https://bitbucket.com/releasequeue/rq-website",
  "devDependencies": {
    "bluebird": "^3.4.6",
    "downsize": "0.0.8",
    "gulp": "^3.9.1",
    "gulp-compile-handlebars": "^0.6.1",
    "gulp-concat": "^2.6.0",
    "gulp-connect": "^5.0.0",
    "gulp-markdown-to-json": "^1.0.1",
    "gulp-minify-css": "^1.2.4",
    "gulp-minify-html": "^1.0.6",
    "gulp-rename": "^1.2.2",
    "gulp-replace": "^0.5.4",
    "gulp-sass": "^2.3.2",
    "gulp-uglify": "^2.0.0",
    "gulp-uncss": "^1.0.6",
    "imagemin-mozjpeg": "^6.0.0",
    "imagemin-optipng": "^5.2.1",
    "imagemin-pngquant": "^5.0.0",
    "moment": "^2.15.1",
    "mout": "^1.0.0",
    "node-inspector": "^0.12.8",
    "require-dir": "^0.3.0",
    "rss": "^1.2.1"
  },
  "scripts": {
    "help": "gulp --tasks",
    "clean": "gulp clean",
    "build": "gulp"
  }
}

Anything wrong on my side?

Ringo

ringods commented 8 years ago

Similar problem report:

http://stackoverflow.com/questions/38253949/gulp-imagemin-dest-on-is-not-a-function-error

ducksoupdev commented 8 years ago

Hi, not sure on the issue. It could be a version incompatibility. Will try and re-create and report back.

ringods commented 8 years ago

@ducksoupdev the node tools/install script did not add the required dependencies to my package.json. So I added the manually without specifying any version. So i got the latest. Once I reverted to the same versions as in the package.json of this repo, all worked correctly.