johnpapa / gulp-patterns

Playground for Gulp Recipes
501 stars 146 forks source link

Installation requires gulp-less #86

Closed rchawdry closed 9 years ago

rchawdry commented 9 years ago

I cloned the repository and followed the instructions, but when I got to the "gulp serve-dev" step, I received the following error:

/Users/rchawdry/tmp/gulptest/gulp-patterns/node_modules/gulp-less/index.js:68 }).done(undefined, cb); ^ TypeError: undefined is not a function at DestroyableTransform._transform (/Users/rchawdry/tmp/gulptest/gulp-patterns/node_modules/gulp-less/index.js:68:8) at DestroyableTransform.Transform._read (/Users/rchawdry/tmp/gulptest/gulp-patterns/node_modules/gulp-less/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10) at DestroyableTransform.Transform._write (/Users/rchawdry/tmp/gulptest/gulp-patterns/node_modules/gulp-less/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12) at doWrite (/Users/rchawdry/tmp/gulptest/gulp-patterns/node_modules/gulp-less/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:237:10) at writeOrBuffer (/Users/rchawdry/tmp/gulptest/gulp-patterns/node_modules/gulp-less/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:227:5) at DestroyableTransform.Writable.write (/Users/rchawdry/tmp/gulptest/gulp-patterns/node_modules/gulp-less/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:194:11) at write (/Users/rchawdry/tmp/gulptest/gulp-patterns/node_modules/gulp-plumber/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24) at flow (/Users/rchawdry/tmp/gulptest/gulp-patterns/node_modules/gulp-plumber/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7) at DestroyableTransform.pipeOnReadable (/Users/rchawdry/tmp/gulptest/gulp-patterns/node_modules/gulp-plumber/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5) at DestroyableTransform.emit (events.js:129:20)

Installing gulp-less via "npm install gulp-less" fixed the issue. Wasn't sure if this needed to be added to the package.json to make sure its downloaded before use.

igorlino commented 9 years ago

you can also make it work by: -Delete directory ./node_modules/gulp-less/ -Opening package.json -Replace

"gulp-less": "^2.0.1",

to

"gulp-less": "2.0.1"

-Execute: npm install

johnpapa commented 9 years ago

gulp-less is in the package.json so the most likely thing that happened is that when you did the npm install something had a problem installing it. It happens sometimes. When it does, I usually delete the node_modules/gulp-less folder and run npm install or npm install gulp-less again. If your local cache gets funky, you can also run npm clear cache.

BTW - if you change your package.json to "gulp-less": "2.0.1" you will be locked on that version. I'd use either ^ or ~, for minor updates or patch updates respectively. My project defaults to ^ .

qkmadson commented 9 years ago

I'm having the same issue. Tried deleting node_modules/gulp-less folder, running npm cache clear, npm install and I get the exact same error.

I tried igorlino's solution of specifying version 2.0.1 over the latest and it resolves the issue for now.

igorlino commented 9 years ago

Yes true. we get stuck with 2.0.1. It was, well, only a workaround.

In the meantime, I updated properly quite a lot of libraries, on the newer side of the versions. it was as part of https://github.com/johnpapa/gulp-patterns/pull/88 BEWARE, there was a minor library change so 2 files would need to be updated. (see the revision)

spiralx commented 9 years ago

Just cloned this today for the first time, and the initial run of npm install had downloadedf gulp-less version 2.0.3, which was failing in the same manner described above. I didn't actually do any clean-up at that point, just ran

npm i --save-dev gulp-less

and it updated gulp-less to 3.0.0, which hasn't caused any issues with any of the tasks I've tried so far.

johnpapa commented 9 years ago

seems this is solved.

stantonk commented 9 years ago

thanks this helped!