3

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://learn.microsoft.com/en-us/appcenter/build/custom/scripts/

lonewolf
  • 31
  • 6

2 Answers2

6

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.

Stephen Saucier
  • 1,925
  • 17
  • 20
  • This might be it. I have somehow built the app by reverting the lock version of package_lock.json to v1. I have added the file and edit this comment when I build the app next time. – lonewolf Sep 15 '22 at 18:11
  • thanks man, I have been really confused for the past 6 hours. The project was okay but then on latest change it decided to break when building – diazlp Apr 18 '23 at 12:32
0

I suppose that you have been encountered with the dependency conflicts issue.

This is a dependency issue, you can ignore it and install npm packages by adding command --force or --legacy-peer-deps

npm install react-rating-tooltip --force

Ceeno Qi-MSFT
  • 924
  • 1
  • 3
  • 5