簡體   English   中英

Netlify 構建命令失敗,退出代碼 1:CI= npm run build (https://ntl.fyi/exit-code-1)ー

[英]Netlify building ーCommand failed with exit code 1: CI= npm run build (https://ntl.fyi/exit-code-1)ー

我第一次嘗試通過 Netlify 部署我的投資組合。 我在這里和那里閱讀了一些文章,我找到了將“CI = npm 運行構建”添加到構建設置的方法。 但它沒有用。 我得到了這個錯誤。 如果有人給我任何提示或修復此錯誤的方法,我將不勝感激。 謝謝你。

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"
   }
 }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM