Upgrade migration from 10.3.1 to 10.4.1 fails with faulty module resolve
See original GitHub issueCurrent Behavior
when executing the migration i get the following error
Running migration @nrwl/workspace:add-explicit-dep-on-tao
Successfully finished @nrwl/workspace:add-explicit-dep-on-tao
---------------------------------------------------------
Running migration @nrwl/linter:update-eslint-configs-to-use-nx-presets
Cannot find module '@angular-devkit/core/src/experimental/workspace'
Require stack:
- /home/max/dev/myproject/node_modules/@nrwl/linter/src/migrations/update-10-4-0/update-eslint-configs-to-use-nx-presets.js
- /home/max/dev/myproject/node_modules/@nrwl/tao/node_modules/@angular-devkit/schematics/tools/export-ref.js
- /home/max/dev/myproject/node_modules/@nrwl/tao/node_modules/@angular-devkit/schematics/tools/index.js
- /home/max/dev/myproject/node_modules/@nrwl/tao/src/commands/migrate.js
- /home/max/dev/myproject/node_modules/@nrwl/tao/index.js
/home/max/dev/myproject/node_modules/yargs/build/lib/yargs.js:1132
throw err;
^
Error: Command failed: npx tao migrate --run-migrations=migrations.json
at checkExecSyncError (child_process.js:616:11)
at Object.execSync (child_process.js:652:15)
at Object.handler (/home/max/dev/myproject/node_modules/@nrwl/workspace/src/command-line/nx-commands.js:74:21)
at Object.runCommand (/home/max/dev/myproject/node_modules/yargs/build/lib/command.js:196:48)
at Object.parseArgs [as _parseArgs] (/home/max/dev/myproject/node_modules/yargs/build/lib/yargs.js:1043:55)
at Object.get [as argv] (/home/max/dev/myproject/node_modules/yargs/build/lib/yargs.js:986:25)
at Object.initLocal (/home/max/dev/myproject/node_modules/@nrwl/cli/lib/init-local.js:24:13)
at Object.<anonymous> (/home/max/dev/myproject/node_modules/@nrwl/cli/bin/nx.js:40:18)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 77769,
stdout: null,
stderr: null
}
Expected Behavior
The migration should run without errors.
Steps to Reproduce
Environment
nx : Not Found
@nrwl/angular : Not Found
@nrwl/cli : 10.4.1
@nrwl/cypress : 10.4.1
@nrwl/eslint-plugin-nx : 10.4.1
@nrwl/express : Not Found
@nrwl/jest : 10.4.1
@nrwl/linter : 10.4.1
@nrwl/nest : 10.4.1
@nrwl/next : Not Found
@nrwl/node : 10.4.1
@nrwl/react : 10.4.1
@nrwl/schematics : Not Found
@nrwl/tao : 10.4.1
@nrwl/web : 10.4.1
@nrwl/workspace : 10.4.1
typescript : 4.1.1-rc
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Upgrading Portal for ArcGIS 10.3.1 to 10.4 fails if Collector and ...
During an upgrade of Portal for ArcGIS 10.3. 1 to 10.4, the upgrade may fail, and return the following error:
Read more >Migrating and Upgrading - TechDocs - Broadcom Inc.
You can migrate the existing SpectroSERVER database and Archive Manager database and other upgradeable components to a different system, and then upgrade DX ......
Read more >Appendix A: Troubleshooting the Upgrade Process
If the upgrade fails or you encounter issues during the upgrade, use the following information to troubleshoot the problem.
Read more >Migration from owncloud 10.3.0 to Nextcloud - Installation
Hello, I have a few problems with migrating from owncloud 10.3.0: I tried ... to fix the error that occurs; UPDATE oc_filecache set...
Read more >VMware Cloud Director 10.3 Release Notes
What's in this Document. What's New; Security; Product Support Notices; Upgrading from Previous Releases; System Requirements and Installation; Resolved ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I hit the same problem migrating one lerna repo with two nx workspaces angular/xplat workspace and one nestjs after upgrading to angular 11.
Angular dev-kit moved workspace from experimental to src folder and even though nx still installs the older dev-kit version, npm is trying to resolve from the upstream installation. Yarns probably resolves it differently and that is why the different results.
Hi @mandarini, thanks for the quick answer.
We use npm, but I think that shouldn’t matter 🤔 But yes, first I executed
nx migrate latest
, then I installed deps withnpm i
and finally i tried to run the migrations withnx migrate --run-migrations=migrations.json
Seems to be a really weird edge case with our repo then 🤔
EDIT: installing packages with yarn did the trick 😅
The question now is, why can’t it resolve the dependency when installing packages with npm 🤔
For anyone that stumbles across this, I executed
rm -rf node_modules
and thenyarn
, after that, running the migrations went throught without any issues, after that i removed the yarn lock file and reinstalled the packages with npm, which seems to work fine everywhere else 🙌Also, I now tried to upgrade to latest, which is, at the time of writing, the version 10.4.4 - first with npm it did fail again, but it eventually worked with yarn.
Somehow the
require
call innode_modules/@nrwl/linter/src/migrations/update-10-4-0/update-eslint-configs-to-use-nx-presets.js
on line 4 is the reason why the migration crashes 🤔