我第一次尝试通过netflix来部署我的投资组合。我在这里和那里读了一些文章,我找到了添加"CI = npm run build"的方法。生成设置。但这并没有奏效。我得到了这个错误。我真的很感激如果有人给我任何提示或方法来解决这个错误。谢谢你。
10:52:03 PM: build-image version: a2d22d22e4555d1ef0a972ed14a0a4b366ad20c4 (focal)
10:52:03 PM: build-image tag: v4.16.3
10:52:03 PM: buildbot version: 4033cea21a3d9a6b51a0c8660e8b7502a7f7abfe
10:52:03 PM: Building without cache
10:52:03 PM: Starting to prepare the repo for build
10:52:03 PM: No cached dependencies found. Cloning fresh repo
10:52:03 PM: git clone --filter=blob:none https://github.com/misato0804/portfolio_TS
10:52:04 PM: Preparing Git Reference refs/heads/main
10:52:04 PM: Parsing package.json dependencies
10:52:06 PM: Starting build script
10:52:06 PM: Installing dependencies
10:52:06 PM: Python version set to 2.7
10:52:06 PM: v16.19.0 is already installed.
10:52:07 PM: Now using node v16.19.0 (npm v8.19.3)
10:52:07 PM: Enabling Node.js Corepack
10:52:07 PM: Started restoring cached build plugins
10:52:07 PM: Finished restoring cached build plugins
10:52:07 PM: Attempting Ruby version 2.7.2, read from environment
10:52:08 PM: Using Ruby version 2.7.2
10:52:08 PM: Using PHP version 8.0
10:52:08 PM: Started restoring cached corepack dependencies
10:52:08 PM: mv: cannot move '/opt/build/cache/.node/corepack' to '/opt/buildhome/.node/corepack': No such file or directory
10:52:08 PM: Finished restoring cached corepack dependencies
10:52:08 PM: No npm workspaces detected
10:52:08 PM: Started restoring cached node modules
10:52:08 PM: Finished restoring cached node modules
10:52:08 PM: Bypassing sha validation. Running pre & post install scripts
10:52:08 PM: Installing npm packages using npm version 8.19.3
10:52:13 PM: npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.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
10:52:16 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
10:52:21 PM: added 1443 packages, and audited 1444 packages in 13s
10:52:21 PM: 212 packages are looking for funding
10:52:21 PM: run `npm fund` for details
10:52:21 PM: 10 high severity vulnerabilities
10:52:21 PM: To address issues that do not require attention, run:
10:52:21 PM: npm audit fix
10:52:21 PM: To address all issues (including breaking changes), run:
10:52:21 PM: npm audit fix --force
10:52:21 PM: Run `npm audit` for details.
10:52:21 PM: npm packages installed
10:52:21 PM: Started restoring cached go cache
10:52:21 PM: Finished restoring cached go cache
10:52:21 PM: go version go1.19.4 linux/amd64
10:52:21 PM: Detected 1 framework(s)
10:52:22 PM: "create-react-app" at version "5.0.1"
10:52:22 PM: Installing missing commands
10:52:22 PM: Verify run directory
10:52:22 PM: Section completed: initializing
10:52:23 PM:
10:52:23 PM: Netlify Build
10:52:23 PM: ────────────────────────────────────────────────────────────────
10:52:23 PM:
10:52:23 PM: ❯ Version
10:52:23 PM: @netlify/build 29.4.5
10:52:23 PM:
10:52:23 PM: ❯ Flags
10:52:23 PM: baseRelDir: true
10:52:23 PM: buildId: 63c4f411035bd37abf71669f
10:52:23 PM: deployId: 63c4f411035bd37abf7166a1
10:52:23 PM:
10:52:23 PM: ❯ Current directory
10:52:23 PM: /opt/build/repo
10:52:23 PM:
10:52:23 PM: ❯ Config file
10:52:23 PM: No config file was defined: using default values.
10:52:23 PM:
10:52:23 PM: ❯ Context
10:52:23 PM: production
10:52:23 PM:
10:52:23 PM: 1. Build command from Netlify app
10:52:23 PM: ────────────────────────────────────────────────────────────────
10:52:23 PM:
10:52:23 PM: $ CI= npm run build
10:52:23 PM: > my-portfolio@0.1.0 build
10:52:23 PM: > react-scripts build
10:52:25 PM: Creating an optimized production build...
10:52:36 PM: Failed to compile.
10:52:36 PM:
10:52:36 PM: static/css/main.908b766b.css from Css Minimizer plugin
10:52:36 PM: /opt/build/repo/static/css/main.908b766b.css:735:25: Double colon [webpack://./src/index.css:6,0][static/css/main.908b766b.css:735,25]
10:52:36 PM:
10:52:36 PM: "build.command" failed
10:52:36 PM: ────────────────────────────────────────────────────────────────
10:52:36 PM:
10:52:36 PM: Error message
10:52:36 PM: Command failed with exit code 1: CI= npm run build (https://ntl.fyi/exit-code-1)
10:52:36 PM:
10:52:36 PM: Error location
10:52:36 PM: In Build command from Netlify app:
10:52:36 PM: CI= npm run build
10:52:36 PM:
10:52:36 PM: Resolved config
10:52:36 PM: build:
10:52:36 PM: command: CI= npm run build
10:52:36 PM: commandOrigin: ui
10:52:36 PM: publish: /opt/build/repo/build
10:52:36 PM: publishOrigin: ui
10:52:36 PM: Caching artifacts
10:52:36 PM: Started saving node modules
10:52:36 PM: Finished saving node modules
10:52:36 PM: Started saving build plugins
10:52:36 PM: Finished saving build plugins
10:52:36 PM: Started saving pip cache
10:52:36 PM: Finished saving pip cache
10:52:36 PM: Started saving emacs cask dependencies
10:52:36 PM: Finished saving emacs cask dependencies
10:52:36 PM: Started saving maven dependencies
10:52:36 PM: Finished saving maven dependencies
10:52:37 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
10:52:36 PM: Started saving boot dependencies
10:52:36 PM: Finished saving boot dependencies
10:52:36 PM: Started saving rust rustup cache
10:52:37 PM: Finished saving rust rustup cache
10:52:37 PM: Started saving go dependencies
10:52:37 PM: Finished saving go dependencies
10:52:37 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:52:37 PM: Failing build: Failed to build site
10:52:37 PM: Finished processing build request in 34.145797224s
我已经尝试过这个构建命令"npm run build"我加了".npmrc"我刚刚写了"legacy-peer-deps=true"在那里)
I could solve it by myself.
The problem was my animation config in Tailwind.config.js
Before fix (it worked dev environmental though)
"animatedText": {
"0%, 100%": {
"background-size": "400% 400%",
"background-position:": "left center"
},
"50%": {
"background-size": "400% 400%",
"background-position": "right center"
}
}
After fix (I could deploy without problem)
"animatedText": {
"0%,to" : {
backgroundSize: "400% 400%",
backgroundPosition: "left center"
},
"50%": {
backgroundSize: "400% 400%",
backgroundPosition: "right center"
},
"100%" : {
backgroundSize: "400% 400%",
backgroundPosition: "left center"
}
}