'Heroku returning Error while running npm install

I'm running the follow command to push my app on Heroku 'git push heroku master', but it returns:

-----> Installing binaries
       engines.node (package.json):  16.13.2
       engines.npm (package.json):   8.1.2
       
       Resolving node version 16.13.2...
       Downloading and installing node 16.13.2...
       npm 8.1.2 already installed with node
       
-----> Installing dependencies
       Installing node modules (package.json)
       npm ERR! code ERESOLVE
       npm ERR! ERESOLVE unable to resolve dependency tree
       npm ERR! 
       npm ERR! While resolving: [email protected]
       npm ERR! Found: [email protected]
       npm ERR! node_modules/zone.js
       npm ERR!   zone.js@"0.11.3" from the root project
       npm ERR! 
       npm ERR! Could not resolve dependency:
       npm ERR! peer zone.js@"~0.10.3" from @angular/[email protected]
       npm ERR! node_modules/@angular/core
       npm ERR!   @angular/core@"11.0.4" from the root project
       npm ERR!   peer @angular/core@"11.0.4" from @angular/[email protected]
       npm ERR!   node_modules/@angular/common
       npm ERR!     @angular/common@"11.0.4" from the root project
       npm ERR! 
       npm ERR! Fix the upstream dependency conflict, or retry
       npm ERR! this command with --force, or --legacy-peer-deps
       npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
       npm ERR! 
       npm ERR! See /tmp/npmcache.GEG9a/eresolve-report.txt for a full report.

Can anyone help me?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source