Tips for reverting from Angular 7 to Angular 6

I attempted to switch from angular 7 back to angular 6 by executing the following npm commands:

npm uninstall -g angular-cli
npm cache clean
npm install -g <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="32535c55475e53401f515e5b5e57">[email protected]</a>

Despite this, my package.json file continues to show angular/cli version 7. I'm in need of guidance on how to successfully revert from angular7 to angular6.

Answer №1

To ensure compatibility, it is important to update the version numbers in your package.json for the following packages:

"@angular/animations": "^7.0.0",
"@angular/cdk": "7.3.3",
"@angular/common": "^7.0.0",
"@angular/compiler": "7.2.6",
"@angular/core": "7.2.6",
"@angular/forms": "^7.0.0",
"@angular/http": "^7.0.0",
"@angular/material": "7.3.3",
"@angular/material-moment-adapter": "^7.3.3",
"@angular/platform-browser": "^7.0.0",
"@angular/platform-browser-dynamic": "^7.0.0",
"@angular/router": "^7.0.0",
"rxjs": "6.4.0",

Additionally, make sure to adjust version numbers in dev-dependencies as follows:

"@angular/compiler-cli": "^7.2.6",
"@angular-devkit/build-angular": "0.13.3",
"typescript": "3.2.4",
"@angular/cli": "~7.3.3",

It's also essential to downgrade any libraries that require downgrading based on Angular's version. Be sure to check error messages after completing this step...

After making these changes, execute:

rm -rf node_modules

In the project's root folder to remove all existing packages.

Next, run:

npm i 

This should resolve any compatibility issues and allow you to proceed smoothly with your project.

Answer №2

It seems like you may have overlooked adding the @ symbol before @angular/cli. Give these steps a try to implement the change globally:

ng --version

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

npm install -g @angular/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cdaec1c4ea96bfbfbf">[email protected]</a>
ng --version

To apply the same change locally within your project folder, omit the -g:

Alternatively, you can manually modify the package.json file, delete the node_modules folder, and then execute npm install in your project directory.

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

What is the best way to access dynamic URL parameters in the Next.js 13 app router from a nested server-side component?

This query pertains to the Server-Side components in Next.js 13 app router: I have a good grasp on how the slug parameter is passed to the default function in app/blog/[slug]/page.tsx: export default function Page({ params }: { params: { slug: string } }) ...

What is the process to install node-fibers using npm on an intranet network?

It seems like the fibers are attempting to communicate with 104.20.23.46:443, but my lack of internet connection is causing the communication to fail. Is there a workaround for this issue? npm install node-fibers-1.0.5.tar.gz > <a href="/cdn-cgi/ ...

What are the best scenarios for creating a constructor in Angular 2 using Typescript?

Check out these sample constructors I found in the Angular 2 documentation: export class AppComponent implements OnInit { title = 'Tour of heroes'; heroes: Hero[]; selectedHero: Hero; constructor(private heroService: HeroService ...

Waiting for a function to complete its processing loop in Angular 7

In my code, I'm dealing with an angular entity called Z which has a property that is a list of another entity named Y. My goal is to delete the entity Z, but before doing so, I need to also delete all the Y entities within it. The challenge arises fro ...

How to configure angular-cli to include server.js in the build output alongside ng build

I'm struggling to find the information in the documentation on how to make this function properly. Is there a specific location within the angular-cli.json file or elsewhere in my application where I can indicate that I would like my node server.js fi ...

Typegoose and NestJS: The 'save' property is not found on this type

I recently started using typegoose and nestjs for my backend-server. In my pages.service.ts file, I already have a function called getPageById() to retrieve a single page by its ID. However, when trying to call this function from another function within th ...

Join the nested Observables array

I have an array that holds objects, each containing two properties where one is an observable value. let myArray = [{def: 'name1', value: EventEmitter_}, {def: 'name2', value: EventEmitter_}] My goal is to subscribe to the observables ...

The Angular2 promise resolves before the web service call has finished executing

I have a service in Angular 2 that contains a function responsible for providing data for a dropdown list. This particular function returns a promise. Below is the code snippet from the service: getStuff(): Promise<Stuff> { return t ...

Issue with MUI icon import: React, Typescript, and MUI type error - Overload does not match this call

Within my component, I am importing the following: import LogoutIcon from "@mui/icons-material/Logout"; import useLogout from "@/hooks/auth/useLogout"; const { trigger: logoutTrigger } = useLogout(); However, when utilizing this compo ...

ERESOLVE encountered issues resolving the dependency tree for a project using .NET Core 3.1 and Vue.js framework

I encountered an issue while trying to build my application. The error message is as follows: npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: <a href="/cdn-cgi/l/email-protection" class ...

What is the process for displaying the attributes of a custom object in Typescript?

I need help returning an array of prop: value pairs for a custom object using the myObject[stringProp] syntax. However, I keep encountering this error message: TS7053: Element implicitly has an 'any' type because expression of type 'str ...

In what way can I utilize const assertions to extract literal types from deeply nested objects?

Let's imagine I have a unique set of individuals: const group = { Alex: ['Ben', 'Chris'], Sarah: ['Dylan'], } as const; With the help of constant clarifications, I can define the specific types like so: type Parent = ...

Every time I attempt to build a React application, I encounter the same error message. I even checked the log file, but it keeps showing the proxy error

An error occurred in the command prompt while installing packages. This process may take a few minutes. Installing react, react-dom, and react-scripts with cra-template... Error: ERR_SOCKET_TIMEOUT The network encountered a socket timeout while trying to ...

Set up global typings by running an npm script

Global Typings Installation > npm install typings -g Added Multiple Global Typings > typings install dt~angular --save --global > typings install dt~angular-ui-router --save --global > typings install dt~ui-grid --save --global > typings ...

Securing Credit Card Numbers with Masked Input in Ionic 3

After testing out 3-4 npm modules, I encountered issues with each one when trying to mask my ion-input for Credit Card numbers into groups of 4. Every module had its own errors that prevented me from achieving the desired masking result. I am looking for ...

Getting event properties in a React component using the rest operator: A comprehensive guide

Can someone please assist me? I am new to TypeScript and struggling with how to use event props in my component. I have defined two props and need all my events as rest props. I encountered an error when trying to use my component with onClick event. The ...

Toggle css comment line using gulp

Is it possible to temporarily deactivate a particular CSS comment on a specific line using Gulp and then reactivate it after completing a build task? As an illustration, I am interested in deactivating the @import 'compass/reset'; statement loca ...

Insert a new item into a current array using Typescript and Angular

-This is my curated list- export const FORMULARLIST: formular[] = [ { id: 1, name: 'Jane Doe', mobileNumber: 987654, secondMobileNumber: 456789, email: '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e1bcc0d9ec ...

Encountering a PropertyTypeError while attempting to process a payment via Stripe in conjunction with use-shopping-cart on Next.js

Upon reaching the checkout page, I encounter the message: Invalid value with type "undefined" was received for stripe. Valid type for stripe is "string". This issue seems to be related to the redirectToCheckout function. Can someone assist me? The cart-s ...

What is the equivalent of Typescript's Uint8Array and Uint16Array in Python?

new Uint8Array(new Uint16Array([64]).buffer) How can I achieve a similar data structure in pure Python? What is the equivalent of Uint8Array/Uint16Array? I am extracting a buffer from a Uint16Array type here and converting it to a Uint8Array, but I am un ...