简体   繁体   English

Ionic v5 到 v6 更新失败?

[英]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,我有一个 ionic 5 项目,需要将其更新到 V6,我遵循了官方文档指南,但是当我尝试将 Angular 更新到最新版本时,它失败并出现以下错误,

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.我认为 Ionic 更新文档不是太详细。 And this is the issue with angular CLI.这就是 angular CLI 的问题。 You should do the update according to official angular update.您应该根据官方 angular 更新进行更新。

https://update.angular.io/

From which angular version are you trying to update?您要从哪个 angular 版本更新? If that doesn't work try removing CLI and clearing cache如果这不起作用,请尝试删除 CLI 并清除缓存

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

and then install CLI v13.然后安装 CLI v13。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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