The Angular version update is experiencing issues within the Bash command prompt

https://i.stack.imgur.com/2ic0N.png

I'm currently using version 6.0.8 of Angular, but when I try to add Angular/PWA to my project, I encounter an error. The command prompt shows my Angular CLI version as 6.0.8, however, in my bash command it displays version 1.7.4. Can someone please assist me with this issue? https://i.stack.imgur.com/hiH2k.png @angular/cli: 1.7.4

Answer №1

If you want to use the ng add command, make sure your Angular CLI version is greater than or equal to 6. However, it seems like you are currently using version 1.7.4, which does not support this command.

For more information on changelog and commands, please visit the following changelog page:

Answer №2

ng add was recently implemented in Angular 6. Make sure to update your CLI for full functionality.

Answer №3

It turns out I made a mistake by updating the global CLI without also updating my project's local CLI. This resulted in the error I was encountering. To resolve the issue, I updated my project's Angular CLI dependency using 'npm update @angular/cli'. This replaced the old CLI with the latest version and successfully solved my problem :)

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

Adding an external JavaScript library to a gateway project: A step-by-step guide

I've been attempting to integrate the Simpl5 JavaScript library into my gateway, but I have encountered some issues. I placed SIPml-api.js and SIPml.js in the webapp/content/scripts directory. In .angular-cli.json, I updated the scripts array as follo ...

Having trouble getting my Angular 2 project up and running

After downloading a MEAN stack project from bitbucket, I attempted to run the front end (Angular 2) locally by navigating to the angular folder and using the command ng serve. However, I encountered the following error: "The serve command requires to be ...

Obtain item from DataSource in Angular's MatTable

In my transaction-history.component.ts file, I have implemented a material data table that fetches data from a query to display it. Here is the code snippet: import { Component, OnInit } from '@angular/core'; import { Transaction } from '.. ...

Tips for implementing a guard feature using a modal window

I am looking to implement a dialog window with yes and no responses when clicking on a router link. If the user selects 'yes', I want to pass through the canActivate guard. The issue arises when returning to the same router with the guard in pla ...

Angular's detectChanges function does not trigger the ngDoCheck method

When I run cdr.detectChanges() in a nested child component (Child1) which has a parent and another nested child component (Child2), only ngDoCheck is invoked in Child2. Why doesn't it invoke DoCheck in the current component (Child1) as well? How can I ...

Issues have arisen with the functionality of Ionic2-Calendar on the device

I'm currently working on a project that involves developing an Ionic 4 app with Angular 8. I've encountered a peculiar issue while using this calendar plugin. It seems similar to the problem discussed in this thread. Despite reaching out for sol ...

What is the best way to activate an <ion-datetime> with an <ion-button>?

Im currently attempting to execute the following action: I would like to select only the month and year using the example below: <ion-datetime presentation="month-year"></ion-datetime> However, I do not wish for this label to be vis ...

Removing a nested data object in Angular with NGXS

I have successfully implemented the get and delete functions for posts in my Angular app. However, I am facing issues when trying to delete a comment within a post using NGXS. How can I access the comment inside the post in order to delete it? Here's ...

Error: Cannot access property 'tb' of an undefined value

While running the Application, I encountered an error in the declaration of constants.ts file where I was assigning data from a json file to constant variables. In the json file named object.json, I had some data structured like this: { "furniture": { ...

Utilizing an image as a background using [ngStyle] in Angular 5

I attempted to set the background of a Div element with an image saved in the database using [ngStyle] in Angular, but unfortunately it did not work as expected. <div class="image" [ngStyle]="{'background': ' url(' + imageUrl + &ap ...

Issue encountered while generating a dynamic listing using Angular

My goal is to generate a dynamic table using Angular. The idea is to create a function where the user inputs the number of rows and columns, and based on those values, a table will be created with the specified rows and columns. However, I am facing an iss ...

Tips on utilizing Selenium with Java to locate and interact with elements on an Angular web application

I'm facing challenges with automating an Angular web app. Despite trying simple code, it still isn't working. Here's an example of my code: @BeforeClass public void setUp() { ChromeOptions options = new ChromeOptions(); ...

Difficulty updating Angular packages using NCU (npm-check-update)

I attempted to update everything on my project by running the following commands: G:\Projects\salarkazazi> npm i -g npm-check-updates The output displayed the following warnings: npm WARN deprecated [email protected]: this library is n ...

How to refresh a specific component or page in Angular without causing the entire page to reload

Is there a way to make the selected file visible without having to reload the entire page? I want to find a cleaner method for displaying the uploaded document. public onFileSelected(event): void { console.log(this.fileId) const file = event.targe ...

Exploring Angular 4: Iterating Over Observables to Fetch Data into a Fresh Array

Context Currently, I am in the process of developing a find feature for a chat application. In this setup, each set of messages is identified by an index. The goal of the `find()` function is to retrieve each message collection reference from the `message ...

Tips for transferring information between service functions in Angular

In my front-end development, I am working on creating a store() function that adds a new question to the database. However, I need to include the active user's ID in the question data before sending it to the back-end. Below is the code for the store ...

What is the best way to prevent users from entering a zero in the first position of a text box using JavaScript

Although I am aware this may be a duplicate issue, the existing solution does not seem to work for me. The field should accept values like: valid - 123,33.00, 100,897,99, 8000 10334 9800,564,88.36 invalid - 001, 0 ...

Vue's v-on:click feature stops functioning correctly post-build

I have successfully integrated the Vue slide example from this link into my Angular template. Everything works fine when running ng serve, but after building with ng build and then trying to start it again with ng serve or from the dist folder using npm s ...

Utilizing Angular 2 canActivate feature to make a promise call to connect with a remote service

Initially, I'm unsure if this approach is the most effective way to tackle the issue at hand. What I am seeking is a route guard on "/" that verifies whether the user is logged in and, if so, redirects them to "/dashboard". It's important for thi ...

Issue: Button ClickEvent is not triggered when the textArea is in onFocus mode

Is there a way to automatically activate a button ClickEvent when the textArea input is focused? Keep in mind that my textArea has some styles applied, causing it to expand when clicked. Here is an example: https://stackblitz.com/edit/angular-ivy-zy9sqj?f ...