Netlify 构建失败,退出代码非零:1

拉尼

我正在尝试通过 GitHub 在 Netlify 上托管我的网站,但是我收到了一个错误。它是用 vanilla JS、HTML 和 CSS 构建的。我收到了一个exit code: 254但后来我创建了一个 package.json 文件,现在我收到了exit code: 1. 当我在开发模式下运行我的网站时,我没有任何问题。我查看了各种问题和答案,但我还没有找到解决方案。

我怎样才能解决这个问题?

部署日志

9:02:16 PM: Build ready to start
9:02:19 PM: build-image version: 6b66e79d54a8f76b01392124644c3052ac0d32ef
9:02:19 PM: build-image tag: v3.3.6
9:02:19 PM: buildbot version: 2ba6f2db8150441c8469e6ae3ab3561a2c9d03fa
9:02:19 PM: Fetching cached dependencies
9:02:19 PM: Starting to download cache of 254.9KB
9:02:19 PM: Finished downloading cache in 67.429279ms
9:02:19 PM: Starting to extract cache
9:02:19 PM: Failed to fetch cache, continuing with build
9:02:19 PM: Starting to prepare the repo for build
9:02:19 PM: No cached dependencies found. Cloning fresh repo
9:02:19 PM: git clone https://github.com/Rahni1/App-Dev-Portfolio
9:02:21 PM: Preparing Git Reference refs/heads/master
9:02:22 PM: Starting build script
9:02:22 PM: Installing dependencies
9:02:23 PM: v10.19.0 is already installed.
9:02:24 PM: Now using node v10.19.0 (npm v6.13.4)
9:02:24 PM: Attempting ruby version 2.6.2, read from environment
9:02:25 PM: Using ruby version 2.6.2
9:02:25 PM: Using PHP version 5.6
9:02:25 PM: Started restoring cached node modules
9:02:25 PM: Finished restoring cached node modules
9:02:26 PM: Installing NPM modules using NPM version 6.13.4
9:02:26 PM: npm
9:02:26 PM:  notice created a lockfile as package-lock.json. You should commit this file.
9:02:26 PM: npm WARN
9:02:26 PM:  [email protected] No description
9:02:27 PM: up to date in 0.347s
9:02:27 PM: found 0 vulnerabilities
9:02:27 PM: NPM modules installed
9:02:27 PM: Started restoring cached go cache
9:02:27 PM: Finished restoring cached go cache
9:02:27 PM: unset GOOS;
9:02:27 PM: unset GOARCH;
9:02:27 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
9:02:27 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
9:02:27 PM: go version >&2;
9:02:27 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
9:02:27 PM: go version go1.12 linux/amd64
9:02:27 PM: Installing missing commands
9:02:27 PM: Verify run directory
9:02:27 PM: Executing user command: npm run build
9:02:27 PM: npm
9:02:27 PM: ERR!
9:02:27 PM:  missing script: build
9:02:27 PM: npm
9:02:27 PM: ERR! A complete log of this run can be found in:
9:02:27 PM: npm ERR!     /opt/buildhome/.npm/_logs/2020-03-10T20_02_27_867Z-debug.log
9:02:27 PM: Skipping functions preparation step: no functions directory set
9:02:27 PM: Caching artifacts
9:02:27 PM: Started saving node modules
9:02:27 PM: Finished saving node modules
9:02:27 PM: Started saving pip cache
9:02:27 PM: Finished saving pip cache
9:02:27 PM: Started saving emacs cask dependencies
9:02:27 PM: Finished saving emacs cask dependencies
9:02:27 PM: Started saving maven dependencies
9:02:27 PM: Finished saving maven dependencies
9:02:27 PM: Started saving boot dependencies
9:02:28 PM: Finished saving boot dependencies
9:02:28 PM: Started saving go dependencies
9:02:28 PM: Finished saving go dependencies
9:02:30 PM: Error running command: Build script returned non-zero exit code: 1
9:02:30 PM: Failing build: Failed to build site
9:02:30 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
9:02:30 PM: Finished processing build request in 11.684569294s

包.json

{
  "name": "portfolio",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/Rahni1/App-Dev-Portfolio.git"
  },
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "https://link-to-github-repo/issues"
  },
  "homepage": "https://link-to-github-repo#readme"
}
够了

Netlify 尝试运行npm run build. 您的 package.json 不包含这样的脚本,您需要添加一个并重试。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Netlify部署“在阶段“构建站点”期间失败:构建脚本返回了非零退出代码:42”

将Gatsby JS网站部署到Netlify时出现“错误运行命令:构建脚本返回了非零退出代码”

Netlify Lambda 函数 - 构建失败

Gatsby网站的Netlify构建失败

Netlify部署在Gatsby构建上失败

Netlify找不到构建命令

Java快速启动构建失败,退出值非零1

Netlify Gatsby构建错误,本地构建

netlify 部署构建对于 gatsby-contentful 站点失败

构建后如何更改Netlify文件

Bash脚本作为Netlify的构建命令

在Netlify构建上更改Hugo版本

@ typeform / embed中断Gatsby Netlify构建

Gatsby Build在Netlify Deploy上失败

我试图通过npm安装netlify,但失败

Netlify部署抛出:错误:无效版本:“ 1”

命令MergeSwiftModule失败,退出代码非零

如果Docker Pipeline Plugin withRun命令返回非零退出代码,如何使Jenkins构建失败?

Apollo iOS:命令/ bin / sh失败,退出代码为1 | 命令PhaseScriptExecution失败,退出代码非零

由于退出错误状态127在netlify上构建Hugo网站时出错

如何为Netlify子域支持构建存储库?

类型错误 .join 不是函数 Netlify 构建错误

在github / netlify上使用hugo从markdown自动构建PDF

设置环境变量以在Netlify中进行构建

在构建中公开的Netlify / Create React App秘密api密钥

Docker Hub上的自动构建中的“异常:非零退出代码:1”

Jekyll 的 Netlify 部署在使用 Docker Compose 时失败

在Netlify上部署失败状态,但站点仍在部署

部署失败-添加子模块问题-使用Netlify