部署失败的Netlify

时间:2020-09-04 12:00:27

标签: javascript html css deployment netlify

Blockquote

2:27:28 PM: Waiting for other deploys from your team to complete
2:27:30 PM: Build ready to start
2:27:32 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
2:27:32 PM: build-image tag: v3.4.1
2:27:32 PM: buildbot version: e1f4178b0d9779ebad1b11d5b54739f82fed3c22
2:27:32 PM: Building without cache
2:27:32 PM: Starting to prepare the repo for build
2:27:32 PM: No cached dependencies found. Cloning fresh repo
2:27:32 PM: git clone https://github.com/EitharAlotoom95/Eithar-Website-
2:27:33 PM: Preparing Git Reference refs/heads/master
2:27:34 PM: Starting build script
2:27:35 PM: Installing dependencies
2:27:35 PM: Python version set to 2.7
2:27:36 PM: v12.18.0 is already installed.
2:27:36 PM: Now using node v12.18.0 (npm v6.14.4)
2:27:36 PM: Started restoring cached build plugins
2:27:36 PM: Finished restoring cached build plugins
2:27:36 PM: Attempting ruby version 2.7.1, read from environment
2:27:38 PM: Using ruby version 2.7.1
2:27:38 PM: Using PHP version 5.6
2:27:38 PM: 5.2 is already installed.
2:27:38 PM: Using Swift version 5.2
2:27:38 PM: Started restoring cached go cache
2:27:38 PM: Finished restoring cached go cache
2:27:38 PM: go version go1.14.4 linux/amd64
2:27:38 PM: go version go1.14.4 linux/amd64
2:27:38 PM: Installing missing commands
2:27:38 PM: Verify run directory
2:27:39 PM: ​
2:27:39 PM: ┌─────────────────────────────┐
2:27:39 PM: │        Netlify Build        │
2:27:39 PM: └─────────────────────────────┘
2:27:39 PM: ​
2:27:39 PM: ❯ Version
2:27:39 PM:   @netlify/build 3.3.5
2:27:39 PM: ​
2:27:39 PM: ❯ Flags
2:27:39 PM:   deployId: 5f5224a05574348ce34178f9
2:27:39 PM:   mode: buildbot
2:27:39 PM: ​
2:27:39 PM: ❯ Current directory
2:27:39 PM:   /opt/build/repo
2:27:39 PM: ​
2:27:39 PM: ❯ Config file
2:27:39 PM:   No config file was defined: using default values.
2:27:39 PM: ​
2:27:39 PM: ❯ Context
2:27:39 PM:   production
2:27:39 PM: ​
2:27:39 PM: ┌───────────────────────────────────┐
2:27:39 PM: │ 1. Build command from Netlify app │
2:27:39 PM: └───────────────────────────────────┘
2:27:39 PM: ​
2:27:39 PM: $ npm run build
2:27:39 PM: npm ERR! code ENOENT
2:27:39 PM: npm ERR! syscall open
2:27:39 PM: npm ERR! path /opt/build/repo/package.json
2:27:39 PM: npm ERR! errno -2
2:27:39 PM: npm ERR! enoent ENOENT: no such file or directory, open '/opt/build/repo/package.json'
2:27:39 PM: npm ERR! enoent This is related to npm not being able to find a file.
2:27:39 PM: npm ERR! enoent
2:27:39 PM: npm ERR! A complete log of this run can be found in:
2:27:39 PM: npm ERR!     /opt/buildhome/.npm/_logs/2020-09-04T11_27_39_874Z-debug.log
2:27:39 PM: ​
2:27:39 PM: ┌─────────────────────────────┐
2:27:39 PM: │   "build.command" failed    │
2:27:39 PM: └─────────────────────────────┘
2:27:39 PM: ​
2:27:39 PM:   Error message
2:27:39 PM:   Command failed with exit code 254: npm run build
2:27:39 PM: ​
2:27:39 PM:   Error location
2:27:39 PM:   In Build command from Netlify app:
2:27:39 PM:   npm run build
2:27:39 PM: ​
2:27:39 PM:   Resolved config
2:27:39 PM:   build:
2:27:39 PM:     command: npm run build
2:27:39 PM:     commandOrigin: ui
2:27:39 PM:     publish: /opt/build/repo/dist
2:27:40 PM: Caching artifacts
2:27:40 PM: Started saving build plugins
2:27:40 PM: Finished saving build plugins
2:27:40 PM: Started saving pip cache
2:27:40 PM: Finished saving pip cache
2:27:40 PM: Started saving emacs cask dependencies
2:27:40 PM: Finished saving emacs cask dependencies
2:27:40 PM: Started saving maven dependencies
2:27:40 PM: Finished saving maven dependencies
2:27:40 PM: Started saving boot dependencies
2:27:40 PM: Finished saving boot dependencies
2:27:40 PM: Started saving go dependencies
2:27:40 PM: Finished saving go dependencies
2:27:42 PM: Error running command: Build script returned non-zero exit code: 1
2:27:42 PM: Failing build: Failed to build site
2:27:42 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1
2:27:42 PM: Finished processing build request in 10.743452323s

我正在尝试在netlify上部署#html #css #js网站,但是它失败并给我这个错误?有解决这个问题的主意吗? 下午2:27:28:等待团队中的其他部署完成 下午2:27:30:构建准备开始 下午2:27:32:构建映像版本:b0258b965567defc4a2d7e2f2dec2e00c8f73ad6 下午2:27:32:构建图像代码:v3.4.1 下午2:27:32:buildbot版本:e1f4178b0d9779ebad1b11d5b54739f82fed3c22 下午2:27:32:无需缓存即可构建 下午2:27:32:开始准备要构建的存储库 下午2:27:32:找不到缓存的依赖项。克隆新鲜回购 下午2:27:32:git clone https://github.com/EitharAlotoom95/Eithar-Website- 2:27:33 PM:准备Git参考refs / heads / master 2:27:34 PM:启动构建脚本 下午2:27:35:安装依赖项 下午2:27:35:Python版本设置为2.7 下午2:27:36:已安装v12.18.0。 2:27:36 PM:现在使用节点v12.18.0(npm v6.14.4) 下午2:27:36:开始恢复缓存的构建插件 下午2:27:36:恢复缓存构建插件已完成 下午2:27:36:尝试使用ruby版本2.7.1,从环境中读取 2:27:38 PM:使用ruby版本2.7.1 2:27:38 PM:使用PHP 5.6 下午2:27:38:已经安装5.2。 2:27:38 PM:使用Swift版本5.2 下午2:27:38:开始还原缓存的go缓存 下午2:27:38:恢复缓存的go缓存完成 2:27:38 PM:go版本go1.14.4 linux / amd64 2:27:38 PM:go版本go1.14.4 linux / amd64 2:27:38 PM:安装缺少的命令 2:27:38 PM:验证运行目录 下午2:27:39 下午2:27:39:┌──────────────┐ 下午2:27:39:│Netlify构建│ 下午2:27:39:└──────────────┘ 下午2:27:39 2:27:39 PM:❯版本 下午2:27:39:@ netlify / build 3.3.5 下午2:27:39 2:27:39 PM:❯旗帜 下午2:27:39:deployId:5f5224a05574348ce34178f9 下午2:27:39:模式:buildbot 下午2:27:39 下午2:27:39:❯当前目录 下午2:27:39:/ opt / build / repo 下午2:27:39 2:27:39 PM:❯配置文件 下午2:27:39:未定义配置文件:使用默认值。 下午2:27:39 2:27:39 PM:❯上下文 2:27:39 PM:生产 下午2:27:39 下午2:27:39:┌──────────────┐ 下午2:27:39:│1.从Netlify应用│生成命令 2:27:39 PM:└──────────────┘ 下午2:27:39 2:27:39 PM:$ npm运行构建 下午2:27:39:npm错误!代码ENOENT 下午2:27:39:npm错误! syscall打开 下午2:27:39:npm错误!路径/opt/build/repo/package.json 下午2:27:39:npm错误!埃尔诺-2 下午2:27:39:npm错误! enoent ENOENT:没有这样的文件或目录,打开'/opt/build/repo/package.json' 下午2:27:39:npm错误! enoent这与npm无法找到文件有关。 下午2:27:39:npm错误!天生的 下午2:27:39:npm错误!可以在以下位置找到此运行的完整日志: 下午2:27:39:npm错误! /opt/buildhome/.npm/_logs/2020-09-04T11_27_39_874Z-debug.log 下午2:27:39 下午2:27:39:┌──────────────┐ 下午2:27:39:│“ build.command”失败│ 下午2:27:39:└──────────────┘ 下午2:27:39 下午2:27:39:错误消息 2:27:39 PM:命令失败,退出代码254:npm run build 下午2:27:39 下午2:27:39:错误位置 下午2:27:39:在Netlify应用程序的Build命令中: 2:27:39 PM:npm运行构建 下午2:27:39 下午2:27:39:已解决的配置 2:27:39 PM:建立: 2:27:39 PM:命令:npm运行构建 2:27:39 PM:commandOrigin:ui 下午2:27:39:发布:/ opt / build / repo / dist 下午2:27:40:缓存工件 下午2:27:40:开始保存构建插件 下午2:27:40:保存构建插件完成 下午2:27:40:开始保存点子缓存 2:27:40 PM:完成保存点子缓存 下午2:27:40:开始保存emacs容器依赖关系 2:27:40 PM:完成保存emacs桶依赖关系 下午2:27:40:开始保存Maven依赖项 2:27:40 PM:完成保存Maven依赖项 下午2:27:40:开始保存启动依赖项 下午2:27:40:完成保存启动依赖项 下午2:27:40:开始保存go依赖项 下午2:27:40:完成保存go依赖项 2:27:42 PM:运行命令时出错:构建脚本返回了非零退出代码:1 下午2:27:42:建立失败:建立网站失败 下午2:27:42:在“建筑工地”阶段失败:构建脚本返回了非零退出代码:1 下午2:27:42:在10.743452323s中完成了处理构建请求

2 个答案:

答案 0 :(得分:0)

一种解决方法是从.gitignore中删除/ build,然后从netlify中的生成设置中删除生成命令(yarn build或npm run build)。

答案 1 :(得分:0)

在使用 netlify 构建站点时,使用命令“CI= npm run build”而不是默认的“npm run build”