Error encountered when updating Angular CLI

I am currently attempting to update my Angular project from version 4 to version 6. After numerous failed attempts to upgrade, I decided to uninstall and reinstall the Angular CLI using 'npm uninstall -g angular-cli' followed by a reinstallation. However, I encountered an error after installing the new Angular CLI.

Error: Cannot find module 'C:\Users\Enoch\Workspaces\Angular IDE 2017 CI\new-front\node_modules\@angular\cli\ember-cli\lib\cli\cli'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\Enoch\Workspaces\Angular IDE 2017 CI\new-front\node_modules\angular-ide\bin\ng:39:19)
...

How can I resolve this error and successfully upgrade my existing project to version 6 without causing further issues? I have been searching for a solution for more than 2 hours now.

This is my current package.json:

{
  "name": "new-front",
  "version": "0.0.0",
  "license": "MIT",
  ...
}

Realizing that upgrading directly from version 4 to 6 may not be ideal, I tried upgrading from 4 to 5 first which resulted in the error below. Subsequently, I uninstalled and reinstalled the Angular CLI, leading to the problems mentioned above.


<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9ef0fbe9b3f8ecf1f0eadeaeb0aeb0ae">[email protected]</a> C:\Users\Enoch\Workspaces\Angular IDE 2017 CI\new-front
+-- @angular/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cbaaa5a2a6aabfa2a4a5b88bfee5f9e5fafb">[email protected]</a>  invalid
+-- @angular/...

Answer №1

Initially, the command you used to install the angular-cli was incorrect; the correct command should be

npm install -g @angular/cli

Furthermore, it is not advisable to skip from version 4 to version 6 as this entails transitioning between major versions (even numbers).

You seem to be encountering an error related to

\new-front\node_modules\@angular\cli\ember-cli\lib\cli\cli'
; please investigate why ember-cli is present in that location.

Lastly, a useful upgrade guide can be found here.

I trust this information proves beneficial.

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

The application is experiencing compilation issues following the creation of mime-type.validator.ts. This problem has been reported by one author

I originally created a file called mime-type.validator.ts. Although I haven't used this file yet in my application, it does exist within my project. However, now my application is failing to compile and displaying the following error message: Faile ...

When using Array.find() in TypeScript, the Subscribe function does not get called

I am currently diving into Typescript and web development, but I've encountered a peculiar issue when subscribing to an event that's leaving me stumped. In my service, I'm using a BehaviorSubject to store a carId, and on a page where there&a ...

Using the Ngclass function with a pair of objects

Can you include 2 objects in an ngclass function like this? <div class="progress-bar"[ngClass]="getProgressValues(obj.val1,obj.val2)"> </div> I am encountering a JSON error. SyntaxError: JSON.parse: bad control character in string literal at l ...

Incorporating Past Projects into an Angular 2 Website

Some time ago, I built a Javascript game utilizing the HTML canvas element for image rendering. Now that I have a personal website created with Angular 2, I am unsure of how to properly embed my game into my site. Due to Angular 2 removing the script tag ...

Ensuring Angular2 Javascript is validating only numerical input and not accepting characters

Access the full project here (excluding nodes_modules): Note: After running the project, all actions related to this issue can be found in the "Edit All" section of the website. Click on that to view the table. The main objective of this website section ...

Filtering relations in TypeORM can be achieved by using various query criteria

Hello, I have a couple of questions regarding TypeORM in TypeScript. Using Find() Only: I have two tables in my database - Users and Sessions. I am interested in retrieving a specific User along with all their Sessions where the sessions_deleted_at column ...

What is the method for defining the type of a variable without assigning a value to it?

Working on an Angular 11 project using Typescript with Strict Mode, I encountered the following issue: export class AvatarComponent { @Input() user: UserModel = null; } This resulted in a compilation error: Type 'null' is not assignable to ty ...

Transforming encoded information into a text format and then reversing the process

I am facing an issue with storing encrypted data in a string format. I have tried using the TextEncoder method but it seems to be creating strings with different bytes compared to the original ArrayBuffer. Here is the line causing the problem: const str ...

Using TypeScript to eliminate duplicate values when constructing an array with various properties

Recently, I received an array from an API that has the following structure: results = [ {name: 'Ana', country: 'US', language: 'EN'}, {name: 'Paul', country: 'UK', language: 'EN'}, {name: & ...

What is the best way to reset the current page using angular pagination?

I used a tutorial on the pagination implementation in my Angular application, which can be found at this link For the search functionality, I have two components. The first is the parent component that includes the search parameters and a button to trigge ...

Tips for providing certificate key file during the deployment of a cloud function?

Within my TypeScript file, the following code is present: import * as admin from 'firebase-admin' import * as functions from 'firebase-functions' const serviceAccountKey = "serviceAccountKey.json" const databaseURL = "https://blahblah. ...

Angular error: Condition failed - the new time must be greater than or equal to the loop time when a new project is being created

Every time I begin a new project in angular, such as using the command ng new proofangular8, an error pops up towards the end of the process. ng new proofangular8 Here is the output: CREATE proofangular8/angular.json (3675 bytes) CREATE proofangular8/p ...

Why is it that the game board component is not appearing on my HTML page?

I am currently facing an issue with a loop in my Angular html file: <div class="board" #board> <div class="row" *ngFor="let row of this.board; let i = index"> <div *ngFor=" ...

A guide on integrating a data deletion feature in Angular applications

On our website's edit page, there is a list of mat cards/workspaces with an edit icon in the top corner of each workspace. Clicking on the edit icon will take you to the edit page for that specific workspace. Within this edit page, there is a delete b ...

Is there a way for me to determine the value that has been assigned to a <li> key attribute in React using Jest and testing-library/react?

In my current project, I am using a combination of React with TypeScript and Jest along with Testing Library for testing purposes. I have a specific requirement to unit test some code where I need to ensure that the person.id is correctly set as the key at ...

Is there a way for me to access the data stored in session storage in Next.js?

One of the components in my project is a slider, which allows users to set the number of columns in an Image Gallery component. This code snippet shows the implementation of the slider component: export default function Slider({ value, handleChange }: ISl ...

Installing a 3rd party plugin in Angular using the Angular-cli tool

When attempting to install angular2-grid on my Angular-cli with version 2.0.0-rc.1, I followed the tutorial exactly as described but encountered an error. zone.js:101 GET http://localhost:4200/node_modules/angular2-grid/dist/NgGrid 404 (Not Found)sche ...

Looking for a specific phrase in the data entered by the user

I am dealing with data in ckeditor that looks like this: <p>test 1</p> <p>test 2</p> <p><img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICw ...

The issue with collapsible elements not functioning properly in an Angular application involving CSS and JS

My implementation of collapsible in a plain HTML page looks like this: <!DOCTYPE html> <html> <head> <title></title> <style> button.accordion { background-color: #777; color: white; cursor: pointer; p ...

Enhance Express Middleware with Typescript for advanced functionality

Currently in the process of developing a REST API using Express and Typescript, I am encountering difficulties when trying to extend the Request/Response objects of Express. Although my IDE shows no errors, Typescript throws TS2339 Errors during compilati ...