Updating Gulp plugins
Asked Answered
P

1

16

When starting a project using a Yeoman generator, say, generator-gulp-webapp, you get a package.json file with all the dependencies.

Is it recommended to update all or any of these dependencies (ex: gulp-useref, gulp-ruby-sass, gulp-bower-files, etc)? What are the implications of doing or not doing so?

Pithead answered 19/11, 2014 at 18:38 Comment(1)
thanks for the -1, now I'd love to find the reason for itPithead
C
32

It is always necessary to update your plugins, as the syntax keeps changing as and then you keep going ahead.

Here’s what I recommend to fix it:

1) npm install -g npm-check-updates

2) npm-check-updates -u

3) rm -fr node_modules

4) npm install

Basically this installs npm-check-updates globally, runs it against your package.json and updates the dependency versions. Then you just delete the node modules folder and re-install.

Chaudfroid answered 19/11, 2014 at 20:53 Comment(4)
done that...21 packages updated! i knew that a lot stuff would break, but fortunately it was no big deal to fix them. anyway, package.json is under source control. thanks!Pithead
Is rm -fr node_modules necessary if only 1 or 2 modules was updated? Is there not a more efficient way to this?Chuipek
I think that after using npm-check-updates -u , you can only run npm update. Correct me if I am wrong please.Actuary
@Chuipek - I do not think it is necessary to run the rm command. The npm install step should take care of cleaning your packages.Combust

© 2022 - 2024 — McMap. All rights reserved.