{"id":1007,"date":"2021-03-26T14:25:54","date_gmt":"2021-03-26T13:25:54","guid":{"rendered":"https:\/\/nguenkam.com\/blog\/?p=1007"},"modified":"2022-06-08T17:56:10","modified_gmt":"2022-06-08T15:56:10","slug":"error-this-version-of-cli-is-only-compatible-with-the-angular-version-but-angular-version-was-found-instead-bugs","status":"publish","type":"post","link":"https:\/\/nguenkam.com\/blog\/index.php\/2021\/03\/26\/error-this-version-of-cli-is-only-compatible-with-the-angular-version-but-angular-version-was-found-instead-bugs\/","title":{"rendered":"Error: This version of CLI is only compatible with the Angular version but angular version was found instead (Bugs)"},"content":{"rendered":"\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/www.thecodebuzz.com\/wp-content\/uploads\/2020\/10\/This-version-of-CLI-is-only-compatible-with-Angular-versions-0-0-0-10-0-0-beta-10-0-0-11-0-0-1024x184.jpg\" alt=\"\" width=\"747\" height=\"134\"\/><\/figure>\n\n\n\n<h4>Resolution<\/h4>\n\n\n\n<p>We get this error  because of  the difference in Angular CLI installed globally Vs local project workspace.<\/p>\n\n\n\n<p>It happens mostly  when we are trying to migrate an older Angular framework (Example- Angular 5 or 6 or 7 or 8 apps to Latest (Ex. Angular 9 or 10, or 11).<\/p>\n\n\n\n<h4>Steps to fix the issue<\/h4>\n\n\n\n<p>Update Angular CLI for a workspace (Local)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install --save --only=dev @angular\/cli@latest<\/code><\/pre>\n\n\n\n<p>Make sure to install the global version using the command with \u2018-g\u2019 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install -g @angular\/cli@latest<\/code><\/pre>\n\n\n\n<p>Run Update command to get a list of all dependencies required to be upgraded.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ng update<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/thecodebuzz.com\/wp-content\/uploads\/2020\/04\/This-version-of-cli-is-only-compatible-with-angular-versions-9.0.0-beta-but-angular-version-8.2.14-was-found-instead-1-1024x290.jpg\" alt=\"\" width=\"739\" height=\"209\"\/><\/figure>\n\n\n\n<p>Next Run update command as below for each individual Angular core package<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ng update @angular\/cli @angular\/core<\/code><\/pre>\n\n\n\n<p>However (sometimes), we will have  to add \u2018\u2013force\u2019 and \u2018\u2013allow-dirty\u2019 flags command additionally to fix all other pending issues.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ng update @angular\/cli @angular\/core --allow-dirty --force<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/www.thecodebuzz.com\/wp-content\/uploads\/2020\/10\/Angular-10-Repository-is-not-clean.-Please-commit-or-stash-any-changes-before-updating-1024x488.jpg\" alt=\"\" width=\"748\" height=\"356\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Resolution We get this error because of the difference in Angular CLI installed globally Vs local project workspace. It happens mostly when we are trying to migrate an older Angular framework (Example- Angular 5 or 6 or 7 or 8 apps to Latest (Ex. Angular 9 or 10, or 11). Steps to fix the issue [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1965,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[37,72],"tags":[116],"_links":{"self":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1007"}],"collection":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1007"}],"version-history":[{"count":1,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1007\/revisions"}],"predecessor-version":[{"id":1008,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1007\/revisions\/1008"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media\/1965"}],"wp:attachment":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}