Ionic v5 to v6 upgrade failed

I’ve got a ionic 5 project and need to update it to V6, i followed the official documentation guide , but when im trying to update Angular to latest version it failed with following error,

C:\Users\Documents\WRepo>npx @angular/cli@13 update @angular/core@13 @angular/cli@13 The installed local Angular CLI version is older than the latest stable version. Installing a temporary version to perform the update. √ Package successfully installed. internal/modules/cjs/loader.js:892   throw err;   ^

Error: Cannot find module 'C:\Users\Documents\WRepo\'C:\Users\AppData\Local\Temp\angular-cli-packages-qTXpp3\node_modules\@angular\cli\bin\ng.js''
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {   code: 'MODULE_NOT_FOUND',   requireStack: [] }

What causes this error and how can i update ionic version successfully ?

Thanks in advance.