1

I'm using Angular 10.x application with Node 14.x and Npm 6.X, now since Node 14 has reached end of life, I really needed to upgrade the at least the Node alone. Am I able to upgrade Node only ?

Or is there any alternative approaches to fix this ? While I tried to upgrade the node to higher versions, I already found some cross dependency conflict issues.

I tried upgrading Node and met up with some cross dependency issues, so is there any minimal way to approach this ?

Updates

  • updated Node to 16.x along with npm and working fine (but node 16.x is also got EOL).
  • I tried a package.json analyser and got 16+ packages that needs review.

Now with or without the influence upgrade Node to 18.x is causing several dependency issues.

8
  • Why not try it out and see what happens? But be aware that Angular 10 is EOL since more than a year, and upgrading it would be a good idea Commented Sep 12, 2023 at 9:52
  • @NicoHaase I tried and upgrade node to 16.x successfully but unfortunately it is scheduled for EOL in September 11 (which was the same date i upgraded, lol ) and upgrading further will causing a cross dependency issues. Commented Sep 12, 2023 at 10:02
  • Sounds like you should resolve these "issues". As you haven't shared any specific problem with them, how should others advise how to resolve them? Commented Sep 12, 2023 at 10:05
  • @NicoHaase i will share the detailed screenshots soon but what i really have confusion is on the approach i am having, should i have to go in any other order ( like in which order should i update all these packages, angular cli and node ) Commented Sep 12, 2023 at 10:09
  • Angular 10 is only compatible with Node 10 or 12 Commented Sep 12, 2023 at 10:27

1 Answer 1

1

when doing an upgrade you really want to consider 4 things:

(1) unit tests

unit tests with 100% coverage should be in place to ensure nothing breaks when upgrading - obviously this is the dream and time does not always allow for this - for smaller sites you may be able to get away with just manual testing

(2) npm packages

You should update as many npm packages as possible first, although this can be quite high risk if your site is massive and there is a lack of unit tests.

Upgrading npm packages (not angular) will hopefully reduce issues with failing peer dependencies, and of course, new packages often include bugfixes, performance improvements

If you have a lot of packages to upgrade then prob best to upgrade low risk ones first - e.g. anything that does not jump a major version (major version upgrades may have breaking changes)

https://www.npmjs.com/package/npm-check-updates is useful here and should be installed globally

a slowly slowly approach should be used here - upgrading all packages at once may make it difficult to identify any upgrades that are causing issues

(3) Angular

Use https://update.angular.io/ to help you

Following the above steps should minimise any problem with an Angular upgrade

However, if you don't want to upgrade Angular or don't have time then you may be able to skip this for now

(4) Node

Go to the next LTS release - avoid non-LTS versions


These are the steps I follow although you may be able to get away without upgrading Angular (again it depends on peer dependencies)

Sometimes forcing an upgrade when you face peer dependency issues by using the --force flag works, although this is potentially risky and should be avoided if at all possible

Sign up to request clarification or add additional context in comments.

1 Comment

thanks for the check list and explainations, what i did was upgrading node without upgrading npm packages and that may be the issue. let me try this way. also iam looking to upgrade angular also but using multiple style packages like mat, ngx, md are making the process painful. let me try this way and will update on this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.