Closed jornare closed 2 years ago
Seems like many of the migrations are missing the "cli" attribute. Adding "cli": "nx" made the migrations run succesfully. (except the cdk upgrade)
Sorry, I wasn't able to reproduce this issue by creating an angular workspace with 12.0.0
npx create-nx-workspace@12.0.0
Then running the migrations to 13.2.0
nx migrate 13.2.0 && nx migrate --run-migrations
Everything runs smoothly for me. :thinking:
Could you please try and create a repo where nx migrate 13.2.0 && nx migrate --run-migrations
fails?
Maybe this will help because I had the exact same problem, but after deleting node_modules and running yarn/npm install again, it worked.
I'm facing the same issue. I tried to install the @angular-devkit/core
dependecy bit it did not helped to resolve the issue
@FrozenPandaz Encountered the issue with a fresh workspace and angular project on Windows 10. https://github.com/cmcgroarty/nx-12-to-13
Rerunning nx migrate --run-migrations
on the repo after install encounters the error on Windows, but works fine on Linux (CentOS 7)
npx create-nx-workspace@12.0.0
nx migrate 13.2.0
npm install
nx migrate --run-migrations
> NX Running migrations from 'migrations.json'
Running migration add-target-dependencies
> NX NOTE Target dependencies have been updated in nx.json
Nx has deprecated strictlyOrderedTargets in favour of targetDependencies.
Based on your configuration the migration has configured targetDependencies for the following targets: build.
Read more here: https://nx.dev/core-concepts/configuration
Successfully finished add-target-dependencies
---------------------------------------------------------
Running migration set-default-base-if-not-set
Successfully finished set-default-base-if-not-set
---------------------------------------------------------
Running migration 13-0-0-config-locations
Successfully finished 13-0-0-config-locations
---------------------------------------------------------
Running migration set-parallel-default
Successfully finished set-parallel-default
---------------------------------------------------------
Running migration update-webpack-browser-config
Successfully finished update-webpack-browser-config
---------------------------------------------------------
Running migration update-storybook
Successfully finished update-storybook
---------------------------------------------------------
Running migration update-angular-eslint-rules
Successfully finished update-angular-eslint-rules
---------------------------------------------------------
Running migration convert-webpack-browser-build-target-to-delegate-build
Successfully finished convert-webpack-browser-build-target-to-delegate-build
---------------------------------------------------------
Running migration update-invalid-import-paths
Successfully finished update-invalid-import-paths
---------------------------------------------------------
Running migration add-postcss-packages
Successfully finished add-postcss-packages
---------------------------------------------------------
Running migration update-angular-config
Successfully finished update-angular-config
---------------------------------------------------------
Running migration update-libraries
Successfully finished update-libraries
---------------------------------------------------------
Running migration update-angular-jest-config
Successfully finished update-angular-jest-config
---------------------------------------------------------
Running migration update-testing-imports
Successfully finished update-testing-imports
---------------------------------------------------------
Running migration schematic-options-13
Cannot find module '@angular-devkit/core'
Require stack:
- ~\AppData\Local\Temp\tmp-24140-14Bhrtd0OOQg\node_modules\@nrwl\tao\src\commands\ngcli-adapter.js
- ~\AppData\Local\Temp\tmp-24140-14Bhrtd0OOQg\node_modules\@nrwl\tao\src\commands\migrate.js
- ~\AppData\Local\Temp\tmp-24140-14Bhrtd0OOQg\node_modules\@nrwl\tao\index.js
~\nx12to13\node_modules\yargs\build\lib\yargs.js:1132
throw err;
^
Error: Command failed: ~\AppData\Local\Temp\tmp-24140-14Bhrtd0OOQg\node_modules\.bin\tao migrate --run-migrations
at checkExecSyncError (child_process.js:790:11)
at execSync (child_process.js:863:15)
at Object.handler (~\nx12to13\node_modules\@nrwl\workspace\src\command-line\nx-commands.js:125:42)
at Object.runCommand (~\nx12to13\node_modules\yargs\build\lib\command.js:196:48)
at Object.parseArgs [as _parseArgs] (~\nx12to13\node_modules\yargs\build\lib\yargs.js:1043:55)
at Object.get [as argv] (~\nx12to13\node_modules\yargs\build\lib\yargs.js:986:25)
at initLocal (~\nx12to13\node_modules\@nrwl\cli\lib\init-local.js:28:79)
at Object.<anonymous> (~\nx12to13\node_modules\@nrwl\cli\bin\nx.js:43:32)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 10076,
stdout: null,
stderr: null
}
(Windows 11) I took the advice above to add "cli": "nx"
to migrations and the devkit/core error is gone but now it's failing on
Running migration set-parallel-default
Successfully finished set-parallel-default
---------------------------------------------------------
Running migration update-angular-config
Successfully finished update-angular-config
---------------------------------------------------------
Running migration update-libraries
Successfully finished update-libraries
---------------------------------------------------------
Running migration update-angular-jest-config
Successfully finished update-angular-jest-config
---------------------------------------------------------
Running migration update-testing-imports
Successfully finished update-testing-imports
---------------------------------------------------------
Running migration schematic-options-13
Successfully finished schematic-options-13
---------------------------------------------------------
Running migration update-angular-config-v13
Successfully finished update-angular-config-v13
---------------------------------------------------------
Running migration update-libraries-v13
Successfully finished update-libraries-v13
---------------------------------------------------------
Running migration drop-ie-polyfills
Successfully finished drop-ie-polyfills
---------------------------------------------------------
Running migration update-gitignore
Successfully finished update-gitignore
---------------------------------------------------------
Running migration migration-v13-router-link-empty-expression
Successfully finished migration-v13-router-link-empty-expression
---------------------------------------------------------
Running migration migration-v13-testbed-teardown
Successfully finished migration-v13-testbed-teardown
---------------------------------------------------------
Running migration migration-v13
Cannot find module 'C:\development\SDS\core-ui-v3\node_modules\@angular\material\schematics/./ng-update/index#updateToV13'
although the updateToV13
exists...
We have exactly the same problem. Deleting the folder node_modules
and re-installing all packages has no effect.
The migration was from the latest Angular 12.2.12 and Nx 13.1.4 on Windows 10 with Node.js 14.17.0 to the latest Nx 13.2.1.
Running migration set-parallel-default
Successfully finished set-parallel-default
---------------------------------------------------------
Running migration update-angular-config
Successfully finished update-angular-config
---------------------------------------------------------
Running migration update-libraries
Successfully finished update-libraries
---------------------------------------------------------
Running migration update-angular-jest-config
Successfully finished update-angular-jest-config
---------------------------------------------------------
Running migration update-testing-imports
Successfully finished update-testing-imports
---------------------------------------------------------
Running migration schematic-options-13
Cannot find module '@angular-devkit/core'
Require stack:
- C:\Temp\tmp-15448-XKPuv1ro0Z8S\node_modules\@nrwl\tao\src\commands\ngcli-adapter.js
- C:\Temp\tmp-15448-XKPuv1ro0Z8S\node_modules\@nrwl\tao\src\commands\migrate.js
- C:\Temp\tmp-15448-XKPuv1ro0Z8S\node_modules\@nrwl\tao\index.js
C:\Data\WAMP\github\VSHosting\Zerops\frontend\node_modules\@nrwl\workspace\node_modules\yargs\build\lib\yargs.js:1132
throw err;
^
Error: Command failed: C:\Temp\tmp-15448-XKPuv1ro0Z8S\node_modules\.bin\tao migrate --run-migrations
at checkExecSyncError (child_process.js:640:11)
at execSync (child_process.js:676:15)
at Object.handler (C:\Data\WAMP\github\VSHosting\Zerops\frontend\node_modules\@nrwl\workspace\src\command-line\nx-commands.js:125:42)
at Object.runCommand (C:\Data\WAMP\github\VSHosting\Zerops\frontend\node_modules\@nrwl\workspace\node_modules\yargs\build\lib\command.js:196:48)
at Object.parseArgs [as _parseArgs] (C:\Data\WAMP\github\VSHosting\Zerops\frontend\node_modules\@nrwl\workspace\node_modules\yargs\build\lib\yargs.js:1043:55)
at Object.get [as argv] (C:\Data\WAMP\github\VSHosting\Zerops\frontend\node_modules\@nrwl\workspace\node_modules\yargs\build\lib\yargs.js:986:25)
at initLocal (C:\Data\WAMP\github\VSHosting\Zerops\frontend\node_modules\@nrwl\cli\lib\init-local.js:28:79)
at Object.<anonymous> (C:\Data\WAMP\github\VSHosting\Zerops\frontend\node_modules\@nrwl\cli\bin\nx.js:43:32)
at Module._compile (C:\Utils\NVM\v14.17.0\node_modules\nx\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 24472,
stdout: null,
stderr: null
}
@FrozenPandaz I'm able to reproduce this in my repo: https://github.com/ideacrew/active-branch-tracker
after running a fresh npm install, then npx nx migrate latest
and npx nx migrate --run-migration
I get the exact same error as the above comments show
EDIT: Running Windows 11 (thanks @andrewalderson)
2nd EDIT: Confirmed that running this same exact process on the above repo on a Mac (12.0.1) works perfectly. No error messaging.
This does seem to be a Windows issue. I have the same issue running the migrations on Windows. As @cmcgroarty pointed out this does work on Linux. I ran the migrations in WSL with Ubuntu without any issues.
I did as @PointSingularity suggested and it finally worked, but if I run npx nx migrate --run-migrations
again after it worked I get the error message again (I ran it again just out of curiosity). Using Windows 10.
I can confirm like @andrewalderson that this seems to be a Windows (11) issue. I ran the migrations inside WSL without any issue.
I'm on windows 10
Experienced the same issue upgrading from 12.7.2 to 13.2.1, on Windows 10 Enterprise.
> NX Running migrations from 'migrations.json'
Running migration set-default-base-if-not-set
Successfully finished set-default-base-if-not-set
---------------------------------------------------------
Running migration 13-0-0-config-locations
Successfully finished 13-0-0-config-locations
---------------------------------------------------------
Running migration set-parallel-default
Successfully finished set-parallel-default
---------------------------------------------------------
Running migration add-postcss-packages
Successfully finished add-postcss-packages
---------------------------------------------------------
Running migration update-angular-config
Successfully finished update-angular-config
---------------------------------------------------------
Running migration update-libraries
Successfully finished update-libraries
---------------------------------------------------------
Running migration update-angular-jest-config
Successfully finished update-angular-jest-config
---------------------------------------------------------
Running migration update-testing-imports
Successfully finished update-testing-imports
---------------------------------------------------------
Running migration ngrx-store-migration-13-beta
Cannot find module '@angular-devkit/core'
Require stack:
- C:\Apps\AppData\Local\Temp\tmp-734204-Xn56dwwmIKOJ\node_modules\@nrwl\tao\src\commands\ngcli-adapter.js
- C:\Apps\AppData\Local\Temp\tmp-734204-Xn56dwwmIKOJ\node_modules\@nrwl\tao\src\commands\migrate.js
- C:\Apps\AppData\Local\Temp\tmp-734204-Xn56dwwmIKOJ\node_modules\@nrwl\tao\index.js
C:\Apps\Projects\ui\node_modules\@nrwl\workspace\node_modules\yargs\build\lib\yargs.js:1132
throw err;
^
Error: Command failed: C:\Apps\AppData\Local\Temp\tmp-734204-Xn56dwwmIKOJ\node_modules\.bin\tao migrate --run-migrations
at checkExecSyncError (child_process.js:643:11)
at execSync (child_process.js:679:15)
at Object.handler (C:\Apps\Projects\ui\node_modules\@nrwl\workspace\src\command-line\nx-commands.js:125:42)
at Object.runCommand (C:\Apps\Projects\ui\node_modules\@nrwl\workspace\node_modules\yargs\build\lib\command.js:196:48)
at Object.parseArgs [as _parseArgs] (C:\Apps\Projects\ui\node_modules\@nrwl\workspace\node_modules\yargs\build\lib\yargs.js:1043:55)
at Object.get [as argv] (C:\Apps\Projects\ui\node_modules\@nrwl\workspace\node_modules\yargs\build\lib\yargs.js:986:25)
at initLocal (C:\Apps\Projects\ui\node_modules\@nrwl\cli\lib\init-local.js:28:79)
at Object.<anonymous> (C:\Apps\Projects\ui\node_modules\@nrwl\cli\bin\nx.js:43:32)
at Module._compile (C:\Apps\npm\node_modules\@nrwl\cli\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 983524,
stdout: null,
stderr: null
}
Thanks for reporting this!
I've pushed a fix for it and we'll cut a patch release with it soon.
If you want to unblock yourself before the fix goes out, you can do the following:
# using npm and cmd
npm install -D @nrwl/tao@latest
SET NX_MIGRATE_USE_LOCAL=true&& nx migrate latest
SET NX_MIGRATE_USE_LOCAL=true&& nx migrate --run-migrations
I've seen some comments in this thread saying to add "cli": "nx"
to migrations missing it, please don't do that, it's not correct. That's a property that identifies migrations created with the Nx DevKit. Migrations from third-party packages might have been created with the Angular DevKit and therefore are not meant to have the "cli": "nx"
. Normally, all migrations from @nrwl/*
packages will have that, and migrations from @angular/*
won't and that's correct.
I'm on a Mac and was seeing the same error. Turns out, I had Angular 14 CLI installed globally. Installing Angular 13 CLI fixed the problem.
In my case, running nvm use
fixed it...
It seems that the reason for this issue is an outdated version of nx. I had it installed locally globally and the migration process didn't update it automatically ofc, so a simple update resolved this issue.
Using npx nx migrate --run-migrations=migrations.json
works for me. Maybe it helps someone struggling with this.
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
While running migrations from nx 12 to nx 13.2.0, a number of migrations fail, complaining that @anguar-devkit/core is not found. I have tried to install this package both in the workspace, but also globally without any success. (v 13.0.3)
Expected Behavior
I expect the migrations to run successfully I have not seen this behaviour earlier.
Steps to Reproduce
I am not in a position to share the code.
Failure Logs
Running migration set-default-base-if-not-set Successfully finished set-default-base-if-not-set
Running migration 13-0-0-config-locations Successfully finished 13-0-0-config-locations
Running migration set-parallel-default Successfully finished set-parallel-default
Running migration add-postcss-packages Successfully finished add-postcss-packages
Running migration update-angular-config Successfully finished update-angular-config
Running migration update-libraries Successfully finished update-libraries
Running migration update-angular-jest-config Successfully finished update-angular-jest-config
Running migration update-testing-imports Successfully finished update-testing-imports
Running migration schematic-options-13 Cannot find module '@angular-devkit/core' Require stack:
Error: Command failed: C:\Users...\AppData\Local\Temp\tmp-19508-D60cNX54O84e\node_modules.bin\tao migrate --run-migrations at checkExecSyncError (child_process.js:760:11) at execSync (child_process.js:833:15) at Object.handler (C:\dev\ForumWebKlient-3\node_modules\@nrwl\workspace\src\command-line\nx-commands.js:125:42) at Object.runCommand (C:\dev\ForumWebKlient-3\node_modules\yargs\build\lib\command.js:196:48) at Object.parseArgs [as _parseArgs] (C:\dev\ForumWebKlient-3\node_modules\yargs\build\lib\yargs.js:1043:55) at Object.get [as argv] (C:\dev\ForumWebKlient-3\node_modules\yargs\build\lib\yargs.js:986:25) at initLocal (C:\dev\ForumWebKlient-3\node_modules\@nrwl\cli\lib\init-local.js:28:79) at Object. (C:\dev\ForumWebKlient-3\node_modules\@nrwl\cli\bin\nx.js:43:32)
at Module._compile (C:\Users\jorn.are.hatlelid\AppData\Roaming\npm\node_modules\nx\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 13104,
stdout: null,
stderr: null
}
Environment
Node : 14.17.4 OS : win32 x64 npm : 6.14.14
nx : 13.2.0 @nrwl/angular : 13.2.0 @nrwl/cli : 13.2.0 @nrwl/cypress : 13.2.0 @nrwl/devkit : 12.10.0 @nrwl/eslint-plugin-nx : 13.2.0 @nrwl/express : undefined @nrwl/jest : 13.2.0 @nrwl/linter : 13.2.0 @nrwl/nest : undefined @nrwl/next : undefined @nrwl/node : undefined @nrwl/nx-cloud : undefined @nrwl/react : undefined @nrwl/react-native : undefined @nrwl/schematics : undefined @nrwl/tao : 13.2.0 @nrwl/web : undefined @nrwl/workspace : 13.2.0 @nrwl/storybook : 12.10.0 @nrwl/gatsby : undefined typescript : 4.4.4 rxjs : 6.6.7
Community plugins: @angular/animations: 13.0.0 @angular/cdk: 13.0.0 @angular/common: 13.0.0 @angular/compiler: 13.0.0 @angular/core: 13.0.0 @angular/forms: 13.0.0 @angular/platform-browser: 13.0.0 @angular/platform-browser-dynamic: 13.0.0 @angular/router: 13.0.0 @datorama/akita: 6.2.4 @fortawesome/angular-fontawesome: 0.9.0 @nebular/theme: 8.0.0 @angular-devkit/build-angular: 13.0.3 @angular/cli: 13.0.3 @angular/compiler-cli: 13.0.0 @angular/language-service: 13.0.0 @storybook/angular: 6.3.12