Nx: Upgrade nrwl/nx to 0.9

Created on 19 Mar 2018  路  6Comments  路  Source: nrwl/nx

I see that nrwl/nx 0.9 was released. I have 0.8
How should I update? With command npm i -g @nrwl/schematics as I installed it?
update:check gives me nothing in return. It is only for updating nx dependencies, not nx itself?

question / discussion

Most helpful comment

From within your workspace dir you can run npm install @nrwl/nx@latest @nrwl/schematics@latest --save-exact to update those versions in your workspace and then run npm run update:check and should see some info.

All 6 comments

A quick summary on how to do it can be found here.

We should be pushing an update to our https://nrwl.io/nx/guide-nx-workspace docs soon that explains the migrate (update) process in more detail.

From within your workspace dir you can run npm install @nrwl/nx@latest @nrwl/schematics@latest --save-exact to update those versions in your workspace and then run npm run update:check and should see some info.

I first run two commands npm i @nrwl/schematics@latest -g (globally as in https://angularplaybook.com/courses/264974/lectures/4113736) and then npm i @nrwl/nx@latest.
With that update:check showed nothing.

Then I installed @nrwl/schematics locally and update:check showed something.

So I have to update @nrwl/schematics locally and globally?

BTW: You have great tool. Very, very needed but I have to admitt that Your docs need work :)

  1. In intro movie: https://nrwl.io/nx is very different way of installing nx then here: https://nrwl.io/nx/guide-nx-workspace
  1. Docs says of using nx-migrate command. If I run that command I have error missing script

  2. Maybe a new script that updates @nrwl as well??

nx-migrate was for older versions I guess.
In new version you have npm run update.

I did migration with following steps:

npm install @nrwl/nx@latest @nrwl/schematics@latest --save-exact
npm run update:check
npm run update

npm uninstall -g @nrwl/schematics
npm cache verify
npm install -g @nrwl/schematics@latest

And I agree that the docs is very poor and outdated.

So I have to update @nrwl/schematics locally and globally?

  • In order to perform a migration you need to update the local @nrwl/schematics and @nrwl/nx
  • It is recommended to keep your global version of @nrwl/schematics as up to date as possible as well to ensure that create-nx-workspace is updated.

Maybe a new script that updates @nrwl as well??

This is in the works! :smile: Might you have a suggestion for how you think it should look?

nx-migrate was for older versions I guess.

This is correct

Docs says of using nx-migrate command.

Thank you for pointing that out. This will be addressed.

Closing this in favor of #348 where more discussion is happening.

Was this page helpful?
0 / 5 - 0 ratings