- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我编写了我的 React 项目,可以在本地主机上运行,也可以在我的计算机上使用 yarn build
命令进行构建。
我将我的项目推送到 github ( Repo )。当我想将我的项目部署到 Vercel 或 Netlify 时,我收到了 Cannot find file '../../components/collection-item/Collection-item' in './src/pages/collection'.
错误,但路径没有问题,我说过我可以在自己的计算机上运行和构建它。我找不到解决办法。我更改了文件名和路径仍然相同。
这是 Netlify 日志:
1:24:32 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
1:24:32 PM: build-image tag: v3.4.1
1:24:32 PM: buildbot version: bca3bbf1ce7c7ca2e2192b1683becc1d98c88c5b
1:24:32 PM: Fetching cached dependencies
1:24:32 PM: Failed to fetch cache, continuing with build
1:24:32 PM: Starting to prepare the repo for build
1:24:32 PM: No cached dependencies found. Cloning fresh repo
1:24:32 PM: git clone https://github.com/OrhanOzkercin/ReactShop
1:24:33 PM: Preparing Git Reference refs/heads/Build
1:24:34 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'build' versus 'build/' in the Netlify UI
1:24:34 PM: Starting build script
1:24:34 PM: Installing dependencies
1:24:34 PM: Python version set to 2.7
1:24:35 PM: v12.18.0 is already installed.
1:24:35 PM: Now using node v12.18.0 (npm v6.14.4)
1:24:35 PM: Started restoring cached build plugins
1:24:35 PM: Finished restoring cached build plugins
1:24:36 PM: Attempting ruby version 2.7.1, read from environment
1:24:37 PM: Using ruby version 2.7.1
1:24:37 PM: Using PHP version 5.6
1:24:37 PM: 5.2 is already installed.
1:24:37 PM: Using Swift version 5.2
1:24:37 PM: Started restoring cached node modules
1:24:37 PM: Finished restoring cached node modules
1:24:37 PM: Started restoring cached yarn cache
1:24:37 PM: Finished restoring cached yarn cache
1:24:37 PM: Installing yarn at version 1.22.4
1:24:37 PM: Installing Yarn!
1:24:37 PM: > Downloading tarball...
1:24:37 PM: [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz --> /tmp/yarn.tar.gz.fZhfENjJTT
1:24:37 PM: % Total % Received % Xferd Average Speed Time Time Time Current
1:24:37 PM: Dload Upload Total Spent Left Speed
1:24:37 PM: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
1:24:37 PM: 100 80 100 80 0 0 249 0 --:--:-- --:--:-- --:--:-- 249
1:24:38 PM: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
1:24:38 PM: 100 93 100 93 0 0 139 0 --:--:-- --:--:-- --:--:-- 332
1:24:38 PM: 100 630 100 630 0 0 612 0 0:00:01 0:00:01 --:--:-- 612
1:24:39 PM: 22 1215k 22 270k 0 0 194k 0 0:00:06 0:00:01 0:00:05 194k
1:24:39 PM: 100 1215k 100 1215k 0 0 840k 0 0:00:01 0:00:01 --:--:-- 17.0M
1:24:39 PM: [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc --> /tmp/yarn.tar.gz.fZhfENjJTT.asc
1:24:39 PM: 100 84 100 84 0 0 2358 0 --:--:-- --:--:-- --:--:-- 2358
1:24:39 PM: 100 97 100 97 0 0 1433 0 --:--:-- --:--:-- --:--:-- 1433
1:24:39 PM: 100 634 100 634 0 0 2905 0 --:--:-- --:--:-- --:--:-- 2905
1:24:39 PM: 100 1028 100 1028 0 0 3986 0 --:--:-- --:--:-- --:--:-- 3986
1:24:39 PM: > Verifying integrity...
1:24:39 PM: gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
1:24:39 PM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>"
1:24:39 PM: gpg: WARNING: This key is not certified with a trusted signature!
1:24:39 PM: gpg: There is no indication that the signature belongs to the owner.
1:24:39 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
1:24:39 PM: Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA
1:24:39 PM: > GPG signature looks good
1:24:39 PM: > Extracting to ~/.yarn...
1:24:39 PM: > Adding to $PATH...
1:24:39 PM: > Successfully installed Yarn 1.22.4! Please open another terminal where the `yarn` command will now be available.
1:24:40 PM: Installing NPM modules using Yarn version 1.22.4
1:24:40 PM: yarn install v1.22.4
1:24:40 PM: [1/4] Resolving packages...
1:24:41 PM: [2/4] Fetching packages...
1:25:03 PM: info fsevents@2.1.2: The platform "linux" is incompatible with this module.
1:25:03 PM: info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
1:25:03 PM: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
1:25:03 PM: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
1:25:03 PM: info fsevents@2.1.3: The platform "linux" is incompatible with this module.
1:25:03 PM: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
1:25:03 PM: [3/4] Linking dependencies...
1:25:03 PM: warning " > @testing-library/user-event@7.2.1" has unmet peer dependency "@testing-library/dom@>=5".
1:25:03 PM: warning "react-scripts > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
1:25:03 PM: warning " > styled-components@5.1.1" has unmet peer dependency "react-is@>= 16.8.0".
1:25:15 PM: [4/4] Building fresh packages...
1:25:17 PM: Done in 36.81s.
1:25:17 PM: NPM modules installed using Yarn
1:25:17 PM: Started restoring cached go cache
1:25:17 PM: Finished restoring cached go cache
1:25:17 PM: go version go1.14.4 linux/amd64
1:25:17 PM: go version go1.14.4 linux/amd64
1:25:17 PM: Installing missing commands
1:25:17 PM: Verify run directory
1:25:18 PM:
1:25:18 PM: ┌─────────────────────────────┐
1:25:18 PM: │ Netlify Build │
1:25:18 PM: └─────────────────────────────┘
1:25:19 PM:
1:25:19 PM: ❯ Version
1:25:19 PM: @netlify/build 3.1.10
1:25:19 PM:
1:25:19 PM: ❯ Flags
1:25:19 PM: deployId: 5f2e7d5a88b3fd0007415022
1:25:19 PM: mode: buildbot
1:25:19 PM: timersFile: /tmp/substage_times.txt
1:25:19 PM:
1:25:19 PM: ❯ Current directory
1:25:19 PM: /opt/build/repo
1:25:19 PM:
1:25:19 PM: ❯ Config file
1:25:19 PM: No config file was defined: using default values.
1:25:19 PM:
1:25:19 PM: ❯ Context
1:25:19 PM: production
1:25:19 PM:
1:25:19 PM: ┌───────────────────────────────────┐
1:25:19 PM: │ 1. Build command from Netlify app │
1:25:19 PM: └───────────────────────────────────┘
1:25:19 PM:
1:25:19 PM: $ yarn build
1:25:19 PM: yarn run v1.22.4
1:25:19 PM: $ react-scripts build
1:25:20 PM: Creating an optimized production build...
1:25:27 PM: Failed to compile.
1:25:27 PM:
1:25:27 PM: ./src/pages/collection/Collectionpage.jsx
1:25:27 PM: Cannot find file '../../components/collection-item/Collection-item' in './src/pages/collection'.
1:25:28 PM: error Command failed with exit code 1.
1:25:28 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
1:25:28 PM:
1:25:28 PM: If the build failed with a warning about "process.env.CI = true", this is due to "create-react-app" treating warnings as errors when in CI. In order to fix this problem, please either:
1:25:28 PM: - Fix the issues highlighted by the warnings above.
1:25:28 PM: - Or modify the "scripts.build" command in your "package.json" from "react-scripts build" to "CI= react-scripts build"
1:25:28 PM: More information can be found at https://docs.netlify.com/configure-builds/troubleshooting-tips/#build-fails-on-warning-message
1:25:28 PM:
1:25:28 PM: ┌─────────────────────────────┐
1:25:28 PM: │ "build.command" failed │
1:25:28 PM: └─────────────────────────────┘
1:25:28 PM:
1:25:28 PM: Error message
1:25:28 PM: Command failed with exit code 1: yarn build
1:25:28 PM:
1:25:28 PM: Error location
1:25:28 PM: In Build command from Netlify app:
1:25:28 PM: yarn build
1:25:28 PM:
1:25:28 PM: Resolved config
1:25:28 PM: build:
1:25:28 PM: command: yarn build
1:25:28 PM: commandOrigin: ui
1:25:28 PM: publish: /opt/build/repo/build
1:25:28 PM: Caching artifacts
1:25:28 PM: Started saving node modules
1:25:28 PM: Finished saving node modules
1:25:28 PM: Started saving build plugins
1:25:28 PM: Finished saving build plugins
1:25:28 PM: Started saving yarn cache
1:25:28 PM: Finished saving yarn cache
1:25:28 PM: Started saving pip cache
1:25:28 PM: Finished saving pip cache
1:25:28 PM: Started saving emacs cask dependencies
1:25:28 PM: Finished saving emacs cask dependencies
1:25:28 PM: Started saving maven dependencies
1:25:28 PM: Finished saving maven dependencies
1:25:28 PM: Started saving boot dependencies
1:25:28 PM: Finished saving boot dependencies
1:25:28 PM: Started saving go dependencies
1:25:28 PM: Finished saving go dependencies
1:25:30 PM: Error running command: Build script returned non-zero exit code: 1
1:25:30 PM: Failing build: Failed to build site
1:25:30 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1
1:25:30 PM: Finished processing build request in 58.952206659s```
最佳答案
进入 package.json 并在脚本中,将 build 替换为:
"build": "CI= react-scripts build",
关于reactjs - 无法部署 React 项目。错误是命令失败,退出代码为 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63314399/
我通过 spring ioc 编写了一些 Rest 应用程序。但我无法解决这个问题。这是我的异常(exception): org.springframework.beans.factory.BeanC
我对 TestNG、Spring 框架等完全陌生,我正在尝试使用注释 @Value通过 @Configuration 访问配置文件注释。 我在这里想要实现的目标是让控制台从配置文件中写出“hi”,通过
为此工作了几个小时。我完全被难住了。 这是 CS113 的实验室。 如果用户在程序(二进制计算器)结束时选择继续,我们需要使用 goto 语句来到达程序的顶部。 但是,我们还需要释放所有分配的内存。
我正在尝试使用 ffmpeg 库构建一个小的 C 程序。但是我什至无法使用 avformat_open_input() 打开音频文件设置检查错误代码的函数后,我得到以下输出: Error code:
使用 Spring Initializer 创建一个简单的 Spring boot。我只在可用选项下选择 DevTools。 创建项目后,无需对其进行任何更改,即可正常运行程序。 现在,当我尝试在项目
所以我只是在 Mac OS X 中通过 brew 安装了 qt。但是它无法链接它。当我尝试运行 brew link qt 或 brew link --overwrite qt 我得到以下信息: ton
我在提交和 pull 时遇到了问题:在提交的 IDE 中,我看到: warning not all local changes may be shown due to an error: unable
我跑 man gcc | grep "-L" 我明白了 Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more inf
我有一段代码,旨在接收任何 URL 并将其从网络上撕下来。到目前为止,它运行良好,直到有人给了它这个 URL: http://www.aspensurgical.com/static/images/a
在过去的 5 个小时里,我一直在尝试在我的服务器上设置 WireGuard,但在完成所有设置后,我无法 ping IP 或解析域。 下面是服务器配置 [Interface] Address = 10.
我正在尝试在 GitLab 中 fork 我的一个私有(private)项目,但是当我按下 fork 按钮时,我会收到以下信息: No available namespaces to fork the
我这里遇到了一些问题。我是 node.js 和 Rest API 的新手,但我正在尝试自学。我制作了 REST API,使用 MongoDB 与我的数据库进行通信,我使用 Postman 来测试我的路
下面的代码在控制台中给出以下消息: Uncaught DOMException: Failed to execute 'appendChild' on 'Node': The new child el
我正在尝试调用一个新端点来显示数据,我意识到在上一组有效的数据中,它在数据周围用一对额外的“[]”括号进行控制台,我认为这就是问题是,而新端点不会以我使用数据的方式产生它! 这是 NgFor 失败的原
我正在尝试将我的 Symfony2 应用程序部署到我的 Azure Web 应用程序,但遇到了一些麻烦。 推送到远程时,我在终端中收到以下消息 remote: Updating branch 'mas
Minikube已启动并正在运行,没有任何错误,但是我无法 curl IP。我在这里遵循:https://docs.traefik.io/user-guide/kubernetes/,似乎没有提到关闭
每当我尝试docker组成任何项目时,都会出现以下错误。 我尝试过有和没有sudo 我在这台机器上只有这个问题。我可以在Mac和Amazon WorkSpace上运行相同的容器。 (myslabs)
我正在尝试 pip install stanza 并收到此消息: ERROR: No matching distribution found for torch>=1.3.0 (from stanza
DNS 解析看起来不错,但我无法 ping 我的服务。可能是什么原因? 来自集群中的另一个 Pod: $ ping backend PING backend.default.svc.cluster.l
我正在使用Hibernate 4 + Spring MVC 4当我开始 Apache Tomcat Server 8我收到此错误: Error creating bean with name 'wel
我是一名优秀的程序员,十分优秀!