Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upgrade existing project scaffolded with Yeoman

Tags:

yeoman

I used generator-angular a few months ago to scaffold a project and the whole ecosystem (karma, Node versions, grunt packages) has moved on quite significantly. I keep running into problems running tests, building things, and so on.

I know I can use nvm to downgrade my Node version and install older packages, but that kind of sucks, especially when there are many developers on the team. I have used the generators for 10+ projects over the past few months so I'm very interested in a solution.

Is there a recommended upgrade path for when new versions of generators are released, apart from just regenerating the project and copying files across?

(Just to note: this isn't a problem with upgrading a Yeoman 0.9 project.)

like image 826
mgnb Avatar asked Aug 28 '13 05:08

mgnb


People also ask

What is Yeoman scaffolding?

Yeoman is an open source scaffolding tool for Web applications that helps developers to get started on a project.


1 Answers

First make sure you have committed everything or have a backup, then just scaffold out over the project again. yo will ask you for each file if you want to overwrite. For those files you haven't edited, just say yes. For the other ones, type d for diff and see what's changed. Then manually do the changes, and run npm install & bower install to get the latest dependencies.

EDIT

As mentionned in comments by Markus Gattol :

yo <generator-name> now already run bower install & npm install i.e. no need to run them explicitly again – Markus Gattol

like image 61
Sindre Sorhus Avatar answered Sep 20 '22 21:09

Sindre Sorhus