错误:命令“npm run build”以 1 退出 - Vercel 错误

时间:2021-07-22 06:29:03

标签: reactjs deployment build vercel

我已经创建了一个 facebook 克隆项目......现在我正在尝试使用 vercel 部署它。
当我点击部署时,输出是这样的。但我不想修复这些,因为它们只是警告而不是错误。只有最后一行有错误。有没有办法改变 package.json 或 package-lock.json?因为我更容易改变这些,而不是修复这些警告 -

11:29:55    Cloning github.com/SpandanManna/Facebook-Clone (Branch: main, Commit: cf66fcf)
11:29:56    Cloning completed: 466.398ms
11:29:56    Analyzing source code...
11:29:57    Installing build runtime...
11:30:00    Build runtime installed: 2.671s
11:30:02    Looking up build cache...
11:30:03    Build Cache not found
11:30:04    Detected package.json
11:30:04    Installing dependencies...
11:30:41    > core-js@2.6.11 postinstall /vercel/path0/node_modules/babel-runtime/node_modules/core-js
11:30:41    > node -e "try{require('./postinstall')}catch(e){}"
11:30:41    > core-js@3.6.5 postinstall /vercel/path0/node_modules/core-js
11:30:41    > node -e "try{require('./postinstall')}catch(e){}"
11:30:41    > core-js-pure@3.6.5 postinstall /vercel/path0/node_modules/core-js-pure
11:30:41    > node -e "try{require('./postinstall')}catch(e){}"
11:30:41    > protobufjs@6.11.2 postinstall /vercel/path0/node_modules/protobufjs
11:30:41    > node scripts/postinstall
11:30:43    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
11:30:43    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:30:43    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
11:30:43    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:30:43    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/jest-haste-map/node_modules/fsevents):
11:30:43    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:30:43    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/fsevents):
11:30:43    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:30:43    added 1749 packages from 812 contributors in 38.599s
11:30:45    76 packages are looking for funding
11:30:45      run `npm fund` for details
11:30:45    Running "npm run build"
11:30:45    > facebook-clone@0.1.0 build /vercel/path0
11:30:45    > react-scripts build
11:30:46    Creating an optimized production build...
11:30:49    The prop value with an expression type of ChainExpression could not be resolved. Please file issue to get this fixed immediately.
11:30:52    The prop value with an expression type of ChainExpression could not be resolved. Please file issue to get this fixed immediately.
11:30:52    The prop value with an expression type of ChainExpression could not be resolved. Please file issue to get this fixed immediately.
11:31:33    Treating warnings as errors because process.env.CI = true.
11:31:33    Most CI servers set it automatically.
11:31:33    Failed to compile.
11:31:33    ./src/reducer.js
11:31:33      Line 13:7:  Unreachable code  no-unreachable
11:31:33    ./src/Profile.js
11:31:33      Line 16:20:   'setScroll' is assigned a value but never used                                                             no-unused-vars
11:31:33      Line 18:11:   'history' is assigned a value but never used                                                               no-unused-vars
11:31:33      Line 31:8:    React Hook useEffect has a missing dependency: 'uid'. Either include it or remove the dependency array     react-hooks/exhaustive-deps
11:31:33      Line 59:11:   'myAccount' is assigned a value but never used                                                             no-unused-vars
11:31:33      Line 174:8:   React Hook useEffect has a missing dependency: 'bio'. Either include it or remove the dependency array     react-hooks/exhaustive-deps
11:31:33      Line 197:21:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text
11:31:33      Line 197:52:  Expected '===' and instead saw '=='                                                                        eqeqeq
11:31:33      Line 224:62:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text
11:31:33      Line 225:60:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text
11:31:33    ./src/Sidebar.js
11:31:33      Line 1:17:  'useState' is defined but never used   no-unused-vars
11:31:33      Line 1:27:  'useEffect' is defined but never used  no-unused-vars
11:31:33    ./src/HomeHeader.js
11:31:33      Line 20:31:   Expected to return a value in arrow function                                                                                                                                                                                                                                                                                                                      array-callback-return
11:31:33      Line 21:33:   Expected '===' and instead saw '=='                                                                                                                                                                                                                                                                                                                               eqeqeq
11:31:33      Line 23:35:   Expected to return a value in arrow function                                                                                                                                                                                                                                                                                                                      array-callback-return
11:31:33      Line 39:6:    React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array                                                                                                                                                                                                                                                       react-hooks/exhaustive-deps
11:31:33      Line 105:6:   React Hook useEffect has a missing dependency: 'users'. Either include it or remove the dependency array                                                                                                                                                                                                                                                          react-hooks/exhaustive-deps
11:31:33      Line 117:11:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                                                                                                                                         jsx-a11y/alt-text
11:31:33      Line 190:34:  Expected '===' and instead saw '=='                                                                                                                                                                                                                                                                                                                               eqeqeq
11:31:33      Line 201:15:  The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
11:31:33      Line 216:13:  The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
11:31:33      Line 218:17:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                                                                                                                                         jsx-a11y/alt-text
11:31:33      Line 226:13:  The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
11:31:33      Line 238:13:  The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
11:31:33      Line 246:13:  The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
11:31:33      Line 254:13:  The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
11:31:33      Line 262:13:  The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid
11:31:33    ./src/Post.js
11:31:33      Line 4:10:    'storage' is defined but never used                                                                            no-unused-vars
11:31:33      Line 6:9:     'Link' is defined but never used                                                                               no-unused-vars
11:31:33      Line 48:30:   Expected '===' and instead saw '=='                                                                            eqeqeq
11:31:33      Line 57:8:    React Hook useEffect has a missing dependency: 'show'. Either include it or remove the dependency array        react-hooks/exhaustive-deps
11:31:33      Line 61:18:   Expected '===' and instead saw '=='                                                                            eqeqeq
11:31:33      Line 75:26:   Expected '===' and instead saw '=='                                                                            eqeqeq
11:31:33      Line 125:8:   React Hook useEffect has a missing dependency: 'postUserId'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
11:31:33      Line 144:13:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images      jsx-a11y/alt-text
11:31:33      Line 147:17:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images      jsx-a11y/alt-text
11:31:33      Line 148:17:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images      jsx-a11y/alt-text
11:31:33      Line 149:17:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images      jsx-a11y/alt-text
11:31:33      Line 150:35:  Expected '===' and instead saw '=='                                                                            eqeqeq
11:31:33      Line 184:72:  Expected '===' and instead saw '=='                                                                            eqeqeq
11:31:33    ./src/ImageUpload.js
11:31:33      Line 4:23:     'auth' is defined but never used                                                                           no-unused-vars
11:31:33      Line 17:21:    'setNoLikes' is assigned a value but never used                                                            no-unused-vars
11:31:33      Line 58:21:    Expected '===' and instead saw '=='                                                                        eqeqeq
11:31:33      Line 58:39:    Expected '===' and instead saw '=='                                                                        eqeqeq
11:31:33      Line 62:26:    Expected '===' and instead saw '=='                                                                        eqeqeq
11:31:33      Line 129:25:   img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text
11:31:33      Line 137:25:   img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text
11:31:33      Line 156:132:  Expected '!==' and instead saw '!='                                                                        eqeqeq
11:31:33      Line 162:21:   img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text
11:31:33    ./src/Login.js
11:31:33      Line 5:20:  'Router' is defined but never used                                                                         no-unused-vars
11:31:33      Line 6:3:   'Switch' is defined but never used                                                                         no-unused-vars
11:31:33      Line 7:3:   'Route' is defined but never used                                                                          no-unused-vars
11:31:33      Line 50:7:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text
11:31:33    ./src/Register.js
11:31:33      Line 66:13:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text
11:31:33    ./src/ProfileSidebar.js
11:31:33      Line 6:18:   'setNPosts' is assigned a value but never used                                                                              no-unused-vars
11:31:33      Line 11:37:  Expected to return a value in arrow function                                                                                array-callback-return
11:31:33      Line 12:41:  Expected '===' and instead saw '=='                                                                                         eqeqeq
11:31:33      Line 21:8:   React Hook useEffect has missing dependencies: 'nposts' and 'username'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
11:31:33      Line 25:37:  Expected to return a value in arrow function                                                                                array-callback-return
11:31:33      Line 26:44:  Expected '===' and instead saw '=='                                                                                         eqeqeq
11:31:33      Line 31:8:   React Hook useEffect has a missing dependency: 'username'. Either include it or remove the dependency array                 react-hooks/exhaustive-deps
11:31:33      Line 41:33:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                   jsx-a11y/alt-text
11:31:33      Line 59:37:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                   jsx-a11y/alt-text
11:31:33    npm ERR! code ELIFECYCLE
11:31:33    npm ERR! errno 1
11:31:33    npm ERR! facebook-clone@0.1.0 build: `react-scripts build`
11:31:33    npm ERR! Exit status 1
11:31:33    npm ERR! 
11:31:33    npm ERR! Failed at the facebook-clone@0.1.0 build script.
11:31:33    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
11:31:33    npm ERR! A complete log of this run can be found in:
11:31:33    npm ERR!     /vercel/.npm/_logs/2021-07-22T06_01_33_544Z-debug.log
11:31:33    Error: Command "npm run build" exited with 1

因此部署不成功。我们是否需要更改 Vercel 的任何设置,或更改我的文件?任何人都可以帮我解决这个错误吗?提前致谢!

0 个答案:

没有答案