TL;DR:我不知道为什么我的 React 应用程序在 AWS Amplify 上构建失败。
你好!我刚开始使用 AWS Amplify 进行部署,需要一些帮助来揭开以下日志的神秘面纱。
# Starting phase: preBuild
# Executing command: yarn install
2020-09-14T02:09:01.005Z [INFO]: yarn install v1.16.0
2020-09-14T02:09:01.102Z [INFO]: [1/4] Resolving packages...
2020-09-14T02:09:01.572Z [INFO]: [2/4] Fetching packages...
2020-09-14T02:09:16.267Z [INFO]: info fsevents@2.1.2: The platform "linux" is incompatible with this module.
info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
2020-09-14T02:09:16.275Z [INFO]: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed …Run Code Online (Sandbox Code Playgroud) 当我尝试将我的函数部署到 firebase 时,我遇到了 ESLint 错误。具体来说,当我认为 firebase 支持箭头函数时,它似乎不喜欢箭头函数。我使用默认提供的 ESLint 来初始化函数文件firebase init functions。
/root/functions/helpertools.js
62:84 error Parsing error: Unexpected token =>
Run Code Online (Sandbox Code Playgroud)
第 62 行是以下代码块的第一行:
const getCostEstimateBetweenPlaceIDs = async (placeIdOrigin,placeIDdestination)=> {
let routeInfo = await calculateRoute(placeIdOrigin,placeIDdestination,true)
let minutes = convertHourMinTextToMinutes(routeInfo.duration)
let miles = convertKMTextToMiles(routeInfo.distance)
return {cost:uberCostEstimate(minutes,miles),minutes:minutes,miles:miles}
}
Run Code Online (Sandbox Code Playgroud)
我.eslintrc.js的如下:
module.exports = {
root: true,
env: {
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"google",
],
rules: {
quotes: ["error", "double"],
},
};
Run Code Online (Sandbox Code Playgroud)
从我的 package.json 中:
"@eslint/eslintrc": {
"version": "0.4.3", …Run Code Online (Sandbox Code Playgroud)