【问题标题】:Encountered this error wile trying to host my project on Vercel by importing my code from Github通过从 Github 导入我的代码尝试在 Vercel 上托管我的项目时遇到此错误
【发布时间】:2022-12-30 02:50:56
【问题描述】:

我应该怎么做才能解决此警告,我是一名自学成才的前端开发人员,目前我正在尝试使用 React 创建和托管我的第一个网页

Cloning gitohub.com/Passion94/React-Apps (Branch: main, Commit: da89a2a)
Cloning completed: 729.612ms
Looking up build cache...
Build Cache not found
Running "vercel build"
Vercel CLI 28.4.12-05a80a4
Installing dependencies...
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
added 1462 packages in 36s
224 packages are looking for funding
  run `npm fund` for details
Detected `package-lock.json` generated by npm 7+...
Running "npm run build"
> my-app@0.1.0 build
> react-scripts build
Could not find a required file.
  Name: index.html
  Searched in: /vercel/path0/public
Error: Command "npm run build" exited with 1

我没有尝试过任何解决方案,无法在 Google 上找到任何内容

【问题讨论】:

  • gitohub.com?真的吗?
  • npm run build 是否在您的本地计算机上干净地执行?该命令在您的包.json
  • 您是否查看过此答案? stackoverflow.com/a/57371378/1024832

标签: javascript reactjs github frontend vercel


【解决方案1】:

svgo 包是一个用于优化 SVG(可缩放矢量图形)文件的 Node.js 模块。它通常用于 Web 开发以优化 SVG 图像以实现更快的加载和更好的性能。

要升级到最新版本的 svgo 包,您可以在终端中运行以下命令 npm 安装 svgo@latest

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-12-16
    • 1970-01-01
    • 2022-06-30
    • 2011-04-24
    • 1970-01-01
    • 2022-10-16
    • 2022-01-20
    相关资源
    最近更新 更多