我使用的是 vmImage:ubuntu-latest。在构建(npm run build)期间出现许多错误,例如:
./src/components/*********/testCard.scss 中出现错误 模块构建失败(来自 ./node_modules/mini-css-extract-plugin/dist/loader.js): ModuleNotFoundError:找不到模块:错误:无法解析“/home/vsts/work/1/s/web/src/components/testCard”中的“./green.png”
最佳答案
当我们使用 vmImage: ubuntu-latest 时,由于引用的组件区分大小写,在构建过程中出现所有这些运行错误。
要避免这些构建错误,请使用 vmImage:macOS-10.15 或最新的 macOS。
关于node.js - Azure DevOps Pipeline - React Js 应用程序构建在构建过程中失败(npm run build),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67416204/