Closed zaunermax closed 3 years ago
When I npm ls
the dependency, it seems to be installed properly though
npm ls @angular-devkit/core
myproject@0.0.0 /home/max/dev/myproject
├── @angular-devkit/core@11.0.1
├─┬ @nestjs/schematics@7.2.2
│ ├── @angular-devkit/core@11.0.0
│ └─┬ @angular-devkit/schematics@11.0.0
│ └── @angular-devkit/core@11.0.0
├─┬ @nrwl/cli@10.4.1
│ └─┬ @nrwl/tao@10.4.1
│ ├── @angular-devkit/core@10.1.7
│ └─┬ @angular-devkit/schematics@10.1.7
│ └── @angular-devkit/core@10.1.7 deduped
├─┬ @nrwl/cypress@10.4.1
│ ├─┬ @angular-devkit/architect@0.1001.7
│ │ └── @angular-devkit/core@10.1.7
│ ├── @angular-devkit/core@10.1.7
│ └─┬ @angular-devkit/schematics@10.1.7
│ └── @angular-devkit/core@10.1.7 deduped
├─┬ @nrwl/eslint-plugin-nx@10.4.1
│ └── @angular-devkit/core@10.1.7
├─┬ @nrwl/jest@10.4.1
│ ├── @angular-devkit/core@10.1.7
│ └─┬ @angular-devkit/schematics@10.1.7
│ └── @angular-devkit/core@10.1.7 deduped
├─┬ @nrwl/nest@10.4.1
│ └─┬ @angular-devkit/schematics@10.1.7
│ └── @angular-devkit/core@10.1.7
├─┬ @nrwl/node@10.4.1
│ ├─┬ @angular-devkit/build-webpack@0.1001.7
│ │ └── @angular-devkit/core@10.1.7
│ ├── @angular-devkit/core@10.1.7
│ └─┬ @angular-devkit/schematics@10.1.7
│ └── @angular-devkit/core@10.1.7 deduped
├─┬ @nrwl/react@10.4.1
│ ├── @angular-devkit/core@10.1.7
│ └─┬ @angular-devkit/schematics@10.1.7
│ └── @angular-devkit/core@10.1.7 deduped
├─┬ @nrwl/web@10.4.1
│ ├── @angular-devkit/core@10.1.7
│ └─┬ @angular-devkit/schematics@10.1.7
│ └── @angular-devkit/core@10.1.7 deduped
└─┬ @nrwl/workspace@10.4.1
├── @angular-devkit/core@10.1.7
├─┬ @angular-devkit/schematics@10.1.7
│ └── @angular-devkit/core@10.1.7 deduped
└─┬ @nrwl/cli@10.4.1
└─┬ @nrwl/tao@10.4.1
└── @angular-devkit/core@10.1.7 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 create-nx-workspace@10.3.1 my-wksp
nx migrate
command: nx migrate @nrwl/workspace@10.4.1
yarn
to install any missing dependencies that the nx migrate
command introduced, when it updated my package.json
nx 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?
@mandarini I think that it is up to you, I could fix it by just installing my deps via yarn, then doing the upgrade and then using npm again. If this issue is not important in the grand scheme of things it's completely fine by me don't worry about me, I am just reporting stuff if i encounter some stuff :raised_hands:
Going to close this as this discussion seems to have resolved the issue :smiley:.
Thanks everyone!
Yes, sorry for not closing it 🙈
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.
Current Behavior
when executing the migration i get the following error
Expected Behavior
The migration should run without errors.
Steps to Reproduce
Environment