【发布时间】:2021-04-29 17:16:47
【问题描述】:
我正在尝试在 Netlify 中部署一个前端反应应用程序,但我收到一个错误。看:
8:10:39 AM: Failed to compile.
8:10:39 AM:
8:10:39 AM: src/App.tsx no-unused-vars
8:10:39 AM: Line 31:21: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
8:10:39 AM: Line 46:25: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
8:10:39 AM: src/components/Countdown.jsx
8:10:39 AM: src/components/LevelUpModal.jsx
8:10:39 AM: Line 16:17: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
8:10:39 AM: src/contexts/ChallengesContext.jsx
8:10:39 AM: Line 3:9: 'reactLocalStorage' is defined but never used no-unused-vars
8:10:39 AM: src/contexts/CountDownContext.jsx eqeqeq
8:10:39 AM: Line 40:8: React Hook useEffect has a missing dependency: 'startNewChallenge'. Either include it or remove the dependency array react-hooks/exhaustive-deps
8:10:39 AM: npm ERR! code ELIFECYCLE
8:10:39 AM: npm ERR! errno 1
8:10:39 AM: npm ERR! moveittypescript@0.1.0 build: `react-scripts build`
8:10:39 AM: npm ERR! Exit status 1
8:10:39 AM: npm ERR!
8:10:39 AM: npm ERR! Failed at the moveittypescript@0.1.0 build script.
8:10:39 AM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
8:10:39 AM: npm ERR! A complete log of this run can be found in:
8:10:39 AM: npm ERR! /opt/buildhome/.npm/_logs/2021-03-01T11_10_39_060Z-debug.log
8:10:39 AM:
8:10:39 AM: ────────────────────────────────────────────────────────────────
8:10:39 AM: "build.command" failed
8:10:39 AM: ────────────────────────────────────────────────────────────────
8:10:39 AM:
8:10:39 AM: Error message
8:10:39 AM: Command failed with exit code 1: npm run build
8:10:39 AM:
8:10:39 AM: Error location
8:10:39 AM: In Build command from Netlify app:
8:10:39 AM: npm run build
8:10:39 AM:
8:10:39 AM: Resolved config
8:10:39 AM: build:
8:10:39 AM: command: npm run build
8:10:39 AM: commandOrigin: ui
8:10:39 AM: publish: /opt/build/repo/build
我已经尝试在 Vercel 中部署,但我收到了同样的错误。警告可能是部署问题吗?
【问题讨论】:
-
部署问题*
-
在vercel中,但是...*
-
你知道你可以edit your question吗?评论用于询问问题或回复其他 cmets。但是感谢您纠正这些错误!