Tips for upgrading Angular without updating Angular CLI

I'm currently facing challenges with installing the correct version of Angular. I keep encountering errors such as

This version of CLI is only compatible with Angular versions ^11.0.0-next || >=11.0.0 <12.0.0, but Angular version 9.1.1 was found instead.

I followed the instructions in the project's package.json file to install Angular using

npm -g install @angular/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8deee1e4cdbcbca3bda3bb">[email protected]</a>
. However, upon running ng --version in the project, I see

Angular CLI: 11.2.1
Node: 14.15.5
OS: win32 x64
Angular: 9.1.1

I'm confused about the discordance, any assistance on this matter would be greatly valued

Answer №1

One way to keep your Angular CLI up to date is by following these steps:

  1. Start by uninstalling the current CLI version
npm uninstall @angular/cli -g
  1. Next, install the Angular CLI to a specific version
npm install @angular/cli@~9.1.0 -g

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Angular Router automatically redirects to the base route from specific routes, but the issue is resolved upon refreshing the page

Have you ever experienced Angular Router redirecting the user back to the base url for certain routes? You might think it's an issue with the app-routing.module.ts file, but it gets even more bizarre. Anomaly #1 This strange behavior only occurs wh ...

Issue with Http Interceptor in Angular 4: Error message - next.handle(...).do is not a valid function

Initially, the HTTPInterceptor I created was functioning well for handling HTTP errors. However, after performing a git pull and npm install, it seems to have encountered issues. The following is the code snippet: import {Injectable} from '@angular/ ...

Module 'angular2/angular2' not found

Currently, I am working on a node application with angular2 and gulp. One of the components I have created is login.ts: import {Component, View} from 'angular2/angular2'; import {FormBuilder, formDirectives } from 'angular2/forms'; @C ...

Implementing Typescript for managing state in React components

Currently, I have a state set up like this: const [newInvoice, setInvoice] = useState<InvoiceType | null>(invoice) The structure of my InvoiceType is as follows: customer_email: string customer_name: string description: string due_date: stri ...

Guide to generating a dropdown menu and linking it with data received from a server

I am completely new to Angular and recently received a project involving it. My task is to create a nested dropdown list for Json data retrieved from a server using Rest Api calls. The data contains a Level attribute that indicates the hierarchy level of ...

"Tips for removing all child elements from a parent element using Angular's Renderer2 in versions 5 and above

Manipulating the DOM programmatically is recommended using Angular's Renderer2. Within my directive, I extract some text from el.nativeElement.innerText, modify it, and aim to append it to my element: const text = renderer.createText(`${el.innerTex ...

Using Cypress and JWT, automate the login process for JHipster

Is there a way to automate the bypassing of the JHipster login screen? This is my goal: let jwt_token before(function fetchUser() { cy.request('POST', '/api/authenticate', { username: 'user', password: &a ...

Unable to redirect to another component using Angular route navigation

I recently started working with Angular and I'm currently building an Angular 4 app. I'm facing an issue where I'm trying to navigate from a module component to a layout component when a button is clicked, but the navigation is not working. ...

The argument representing 'typeof Store' cannot be assigned to the parameter representing 'Store<AppState>'

I'm encountering an issue while trying to expand a service in Angular that utilizes ngrx. The error message I'm receiving is as follows: Argument of type 'typeof Store' is not assignable to parameter of type 'Store<AppState>& ...

Beware: React higher-order component alert - Caution: It is not possible to modify a component from within the function body of another

Recently, I crafted a simple higher-order component that retrieves data from an API endpoint and handles loading, error messages, or displaying content upon success. Although the component functions correctly, it triggers the following error message: War ...

Is there a more efficient method for coding this switch/case in TypeScript?

I'm working on a basic weather application using Angular and I wanted some advice on selecting the appropriate image based on different weather conditions. Do you have any suggestions on improving this process? enum WeatherCodition { Thunderstorm ...

Angular - Switching Displayed Information

I am currently working with Angular 4 and I am attempting to switch between contenteditable="true" and contenteditable="false" Here is what I have so far: <h1 (dblclick)="edit($event)" contentEditable="true">Double-click Here to edit</h1> Al ...

Use a mock HTTP response instead of making an actual server call in Angular 4

I am facing a scenario where I have a function myFunc() that I subscribe to. When this function is called with X parameter, I expect a regular HTTP response from the server. However, if it is called without the X parameter, I want it to return a 'mo ...

Error: The argument passed to the function must be an Array type. Undefined value was received instead of an array

Looking for some assistance with this coding issue, hoping someone with expertise can lend a hand! (Not my forte) I've written this Typescript code snippet for a basic CloudFunction export const add2list = functions.https.onRequest((req:any , res:any ...

Sliding toggle in Angular Material2 Menu

How can I properly include a Slide-toggle <mat-slide-toggle> within a Menu <mat-menu>? In addition, when I toggle the Slide-toggle, the menu closes. Is there a way to prevent this behavior? <mat-menu #menuSettings="matMenu"> ...

Establishing connections to numerous databases using ArangoDB

I am currently developing a product that involves the dynamic creation of a new database for each project, as new teams will be creating new projects based on their specific needs. The backend of the product is built using Node.js, Express.js, TypeScript, ...

Launching npm start does not automatically open a browser tab

I'm currently learning angularjs 2 and I'm eager to create my first application using the framework. Following the guidelines on their official website, I proceeded with all the steps outlined in this link. In step 6, I am required to run the com ...

What is the best way to set up Storybook with Vue Cli 3?

I'm facing difficulties installing Storybook in a Vue Cli 3 project. Every time I try to npm run storybook, I encounter this error: Cannot find module '@storybook/vue/dist/server/config/defaults/webpack.config.js' I suspect that this i ...

Instructions for adding a new property dynamically when updating the draft using immer

When looking at the code snippet below, we encounter an error on line 2 stating Property 'newProperty' does not exist on type 'WritableDraft<MyObject>'. TS7053 // data is of type MyObject which until now has only a property myNum ...

Context API is failing to work in components that use children when the version is v16.6.0 or higher

Currently, I am utilizing the latest context API of React (v16.6.0 or higher) by specifying the public static contextType inside the component that consumes the context. Everything works smoothly unless the component declaring the Provider directly include ...