I got the following issue while upgrading from Angular 12 to 13.0.3.
Using package manager: 'npm'
Collecting installed dependencies...
Found 79 dependencies.
Fetching dependency metadata from registry...
Updating package.json with dependency @angular-devkit/build-angular @ "13.0.3" (was "12.2.13")...
Updating package.json with dependency @angular/cli @ "13.0.3" (was "12.2.13")...
Updating package.json with dependency @angular/compiler-cli @ "13.0.2" (was "12.2.13")...
Updating package.json with dependency @angular/language-service @ "13.0.2" (was "12.2.13")...
Updating package.json with dependency typescript @ "4.4.4" (was "4.3.5")...
Updating package.json with dependency @angular/animations @ "13.0.2" (was "12.2.13")...
Updating package.json with dependency @angular/common @ "13.0.2" (was "12.2.13")...
Updating package.json with dependency @angular/compiler @ "13.0.2" (was "12.2.13")...
Updating package.json with dependency @angular/core @ "13.0.2" (was "12.2.13")...
Updating package.json with dependency @angular/forms @ "13.0.2" (was "12.2.13")...
Updating package.json with dependency @angular/localize @ "13.0.2" (was "12.2.13")...
Updating package.json with dependency @angular/platform-browser @ "13.0.2" (was "12.2.13")...
Updating package.json with dependency @angular/platform-browser-dynamic @ "13.0.2" (was "12.2.13")...
Updating package.json with dependency @angular/router @ "13.0.2" (was "12.2.13")...
UPDATE package.json (5301 bytes)
✔ Packages successfully installed.
** Executing migrations of package '@angular/cli' **
...
> Migrates `[routerLink]=""` in templates to `[routerLink]="[]"` because these links are likely intended to route to the current page with updated fragment/query params.
× Migration failed: Cannot read property 'readWorkspace' of undefined
See "C:\Users\BENEDI~1\AppData\Local\Temp\ng-0SNaUB\angular-errors.log" for further details.
The angular-errors.log content is simply this:
[error] TypeError: Cannot read property 'readWorkspace' of undefined
at C:\angular_upgrade\Nova\Avatar\node_modules\@angular\core\schematics\utils\project_tsconfig_paths.js:117:59
at Generator.next (<anonymous>)
at C:\angular_upgrade\Nova\Avatar\node_modules\@angular\core\schematics\utils\project_tsconfig_paths.js:14:71
at new Promise (<anonymous>)
at __awaiter (C:\angular_upgrade\Nova\Avatar\node_modules\@angular\core\schematics\utils\project_tsconfig_paths.js:10:12)
at getWorkspace (C:\angular_upgrade\Nova\Avatar\node_modules\@angular\core\schematics\utils\project_tsconfig_paths.js:115:16)
at C:\angular_upgrade\Nova\Avatar\node_modules\@angular\core\schematics\utils\project_tsconfig_paths.js:40:37
at Generator.next (<anonymous>)
at C:\angular_upgrade\Nova\Avatar\node_modules\@angular\core\schematics\utils\project_tsconfig_paths.js:14:71
at new Promise (<anonymous>)
Has anyone encountered this and how do you fix it?
Rgds, Benedict
For me the following steps helped:
angular-devkit/core. Because it exports that missing function readWorkspace.
npm i angular-devkit/core --save-devnpx @angular/cli@13 update @angular/core@13 @angular/cli@13This should work after installing from npm using migrate-only.
ng update --migrate-only --from=12 --to=13 @angular/core
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With