简体   繁体   中英

Ionic v5 to v6 update 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.

I think that Ionic update documentation is not too detailed. And this is the issue with angular CLI. You should do the update according to official angular update.

https://update.angular.io/

From which angular version are you trying to update? If that doesn't work try removing CLI and clearing cache

npm uninstall -g @angular/cli
npm cache clean --force
npm cache verify

and then install CLI v13.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM