DeborahK / Angular-GettingStarted

Sample Angular application used in the "Angular: Getting Started" course: http://bit.ly/Angular-GettingStarted
MIT License
2.56k stars 3.98k forks source link

Unable to resolve "Conflicting peer dependencies" #169

Open panksahu opened 1 year ago

panksahu commented 1 year ago

Hello, I am facing peer dependencies issue while deployIng the code directly from VSCode (internally it calls TeamsFx.Deploy==>running the npm install to install dependencies on azure).

Though I had manually adding in package.json for peerDependencies, but didn't got any clue for the correct fix...on local I ma able to run it by execute command.

1-Delete node_module folder and the package-lock.json file. 2-Run npm cache verify to verify and clean up your npm. 3-npm install --legacy-peer-deps

Throwing below error if trying deploy on azure from VS Code.

stack: Error: Command failed: npm install npm WARN config global --global, --local are deprecated. Use --location=global instead. npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: msteams-react-base-component@3.1.1 npm ERR! Found: @microsoft/teams-js@2.7.1 npm ERR! node_modules/@microsoft/teams-js npm ERR! @microsoft/teams-js@"^2.0.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @microsoft/teams-js@"^1.8.0" from msteams-react-base-component@3.1.1 npm ERR! node_modules/msteams-react-base-component npm ERR! msteams-react-base-component@"^3.1.0" from the root project npm ERR! npm ERR! Conflicting peer dependency: @microsoft/teams-js@1.12.1 npm ERR! node_modules/@microsoft/teams-js npm ERR! peer @microsoft/teams-js@"^1.8.0" from msteams-react-base-component@3.1.1 npm ERR! node_modules/msteams-react-base-component npm ERR! msteams-react-base-component@"^3.1.0" 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.

image

My package json is: image

DeborahK commented 1 year ago

I have not attempted to deploy to Azure so I don't have any experience or suggestions to offer.

Consider posting to Stackoverflow instead. The experts there should be able to help you.

simply-simpy commented 1 year ago

Ensure the versions of Node/NPM are the same across environments.

samiop commented 3 months ago

Try this out : rm -rf node_modules package-lock.json npm install npm install --legacy-peer-deps

PS: it worked for me when i executed these commands