Closed netwobble closed 5 years ago
The process is to update your versions of @nrwl/schematics and @nrwl/nx to latest, and then run: npm run nx-migrate
. The nx-migrate command will update the versions of Angular, TypeScript, RxJS, NgRx, and CLI.
@jschwarty could you update the docs to describe the command in more detail?
When i run npm run nx-migrate it shows me the message: No migrations to run Even all my packages are not on the latest (nx, schematics, angular, typescript, cli) and so one.
I'm doing something wrong?
Thanks
@abnersouza you need to update @nrwl/schematics and @nrwl/nx first, then run nx-migrate.
I've updated to the latest version, 0.9.1
and I still can't do the npm run nx-migrate
, I get the same error message as @abnersouza.
Also, when running nx update
I get this error message
Running 20171211-create-tsconfigapp-per-app
Create tsconfig.app.json for every app
Migration 20171211-create-tsconfigapp-per-app failed
{ Error: ENOENT: no such file or directory, unlink 'tsconfig.app.json'
at Object.fs.unlinkSync (fs.js:1081:18)
at Object.run (/Users/webtrix/.config/yarn/global/node_modules/@nrwl/schematics/migrations/20171211-create-tsconfigapp-per-app.js:20:14)
at /Users/webtrix/.config/yarn/global/node_modules/@nrwl/schematics/src/command-line/update.js:75:25
at Array.forEach (<anonymous>)
at run (/Users/webtrix/.config/yarn/global/node_modules/@nrwl/schematics/src/command-line/update.js:71:16)
at Object.update (/Users/webtrix/.config/yarn/global/node_modules/@nrwl/schematics/src/command-line/update.js:18:13)
at Object.<anonymous> (/Users/webtrix/.config/yarn/global/node_modules/@nrwl/schematics/src/command-line/nx.js:21:18)
at Module._compile (module.js:641:30)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
errno: -2,
code: 'ENOENT',
syscall: 'unlink',
path: 'tsconfig.app.json' }
Please run 'git checkout .'
Ran the git checkout .
command and tried again, but no luck
Having done some manual migrations and fixing lots of similar problems.
The migration is trying to delete tsconfig.app.json it expects the file to exist and so fails if it doesnt rather than continue to potentially cause other issues.
If you simple create the file as an empty file, the migration script should finish fine. This is likely an artifact of a earlier manual migration or in my case a ng-cli 0.3 structure that has been through a lot.
It looks like it is an issue with a particular migration that results in error in workspaces without the root tsconfig.app.json.
We are trying to write "forgiving" migrations, so they can work on the workspaces that are different from what Nx expects. 20171211-create-tsconfigapp-per-app
expected tsconfig.app.json to be available, but it looks like your repo doesn't have it.
There are two options: You can skip this migration, or you can create the file, so the migration works as expected. I suggest doing the latter.
@maartentibau in addition to git checkout .
, you probably want to run git clean -fd
. Basically you need to make sure that git status
returns nothing to commit, working tree clean
.
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Using the nx-migrate command (according to the documentation) updates the angular cli. Is this the only purpose of this? Does this upgrade to latest nx schematics?
Some things that I noticed ...
In order to stay in sync ... should the process be ... nx-migrate then look through package.json to find latest supported packages?
OR just run the npm update?
OR Both ...
thanks AJ
also @jschwarty - possibly update your awesome starter course on keeping up to date.