在构建 React Native 应用程序时,如何在 Microsoft AppCenter 中将 npm install 命令配置为“npm install --legacy-peer-deps”

lon*_*olf 5 build.gradle react-native npm-install azure-pipelines visual-studio-app-center

附件文件

我正在尝试从应用程序中心构建我的反应本机应用程序。我有依赖项冲突,在 VSCode 中运行时我使用命令“npm install --legacy-peer-deps”,但在应用程序中心,如何配置相同的命令而不仅仅是 npm install 以便生成 node_modules 并且构建不会失败?提前致谢!

我找到了这篇文章,但它对我来说并不完全有意义。

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

Ste*_*ier 8

您可以将.npmrc文件添加到项目的根目录,并包含以下行:

legacy-peer-deps=true

这为构建过程提供了有关您对 npm 偏好的上下文。