[FIXED] How to configure the npm install comnand to "npm install –legacy-peer-deps" in Microsoft AppCenter while building a react native app

Issue

File Attached

I am trying to build my react native app from App Center. I have dependency conflicts, while running in VSCode I use the command "npm install –legacy-peer-deps" but in App center, how do I configure the same command not just npm install so that node_modules are generated and build does not fail? Thanks in advance!

I found this article but it did not make complete sense to me.

https://docs.microsoft.com/en-us/appcenter/build/custom/scripts/

Solution

You can add an .npmrc file to the root of your project, and include this line:

legacy-peer-deps=true

This gives context to the build process about your preferences for npm.

Answered By – Stephen Saucier

Answer Checked By – Marilyn (Easybugfix Volunteer)

Leave a Reply

(*) Required, Your email will not be published