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
}
The migration should run without errors.
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
When I npm ls the dependency, it seems to be installed properly though
npm ls @angular-devkit/core
[email protected] /home/max/dev/myproject
โโโ @angular-devkit/[email protected]
โโโฌ @nestjs/[email protected]
โ โโโ @angular-devkit/[email protected]
โ โโโฌ @angular-devkit/[email protected]
โ โโโ @angular-devkit/[email protected]
โโโฌ @nrwl/[email protected]
โ โโโฌ @nrwl/[email protected]
โ โโโ @angular-devkit/[email protected]
โ โโโฌ @angular-devkit/[email protected]
โ โโโ @angular-devkit/[email protected] deduped
โโโฌ @nrwl/[email protected]
โ โโโฌ @angular-devkit/[email protected]
โ โ โโโ @angular-devkit/[email protected]
โ โโโ @angular-devkit/[email protected]
โ โโโฌ @angular-devkit/[email protected]
โ โโโ @angular-devkit/[email protected] deduped
โโโฌ @nrwl/[email protected]
โ โโโ @angular-devkit/[email protected]
โโโฌ @nrwl/[email protected]
โ โโโ @angular-devkit/[email protected]
โ โโโฌ @angular-devkit/[email protected]
โ โโโ @angular-devkit/[email protected] deduped
โโโฌ @nrwl/[email protected]
โ โโโฌ @angular-devkit/[email protected]
โ โโโ @angular-devkit/[email protected]
โโโฌ @nrwl/[email protected]
โ โโโฌ @angular-devkit/[email protected]
โ โ โโโ @angular-devkit/[email protected]
โ โโโ @angular-devkit/[email protected]
โ โโโฌ @angular-devkit/[email protected]
โ โโโ @angular-devkit/[email protected] deduped
โโโฌ @nrwl/[email protected]
โ โโโ @angular-devkit/[email protected]
โ โโโฌ @angular-devkit/[email protected]
โ โโโ @angular-devkit/[email protected] deduped
โโโฌ @nrwl/[email protected]
โ โโโ @angular-devkit/[email protected]
โ โโโฌ @angular-devkit/[email protected]
โ โโโ @angular-devkit/[email protected] deduped
โโโฌ @nrwl/[email protected]
โโโ @angular-devkit/[email protected]
โโโฌ @angular-devkit/[email protected]
โ โโโ @angular-devkit/[email protected] deduped
โโโฌ @nrwl/[email protected]
โโโฌ @nrwl/[email protected]
โโโ @angular-devkit/[email protected] deduped
Hi there @zaunermax !
Unfortunately I could not reproduce your issue..
Let me tell you the steps I followed, to see if we're on the same page:
10.3.1: npx [email protected] my-wkspnx migrate command: nx migrate @nrwl/[email protected]yarn to install any missing dependencies that the nx migrate command introduced, when it updated my package.jsonnx migrate --run-migrations=migrations.json to complete the migration.All steps ran successfully with no errors.
Can you please let me know if you followed the same steps? Could you have, potentially, forgotten to ran yarn after the first nx migrate command?
Hi @mandarini, thanks for the quick answer.
We use npm, but I think that shouldn't matter :thinking: But yes, first I executed nx migrate latest, then I installed deps with npm i and finally i tried to run the migrations with nx migrate --run-migrations=migrations.json
Seems to be a really weird edge case with our repo then :thinking:
EDIT: installing packages with yarn did the trick :sweat_smile:
The question now is, why can't it resolve the dependency when installing packages with npm :thinking:
For anyone that stumbles across this, I executed rm -rf node_modules and then yarn, 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 :raised_hands:
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 in node_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 :thinking:
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.
Wow, good catch :clap: I didn't really have time to go into the topic more deeply as I had a set time constraint for upgrading nx. I was thrown off, because npm ls would resolve the dep so I was confused
With the hint from @zaunermax I first ran npm install THEN nx migrate --run-migrations=migrations.json
With the hint from @zaunermax I first ran npm install THEN nx migrate --run-migrations=migrations.json
when migrating, you always have to run install first - it just wouldn't resolve correctly if I installed it with npm - I had to install deps with yarn to get it to work...
Hi @zaunermax ! Do you think that we could close this issue now?