与GitHub(gulp)Netlify集成的问题

neekobn8  于 2022-12-08  发布在  Gulp
关注(0)|答案(2)|浏览(242)

当您从GitHub存储库添加站点并进行部署时发生错误:

6:36:32 PM: Build ready to start
6:36:35 PM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
6:36:35 PM: build-image tag: v3.3.2
6:36:35 PM: buildbot version: ef8d0929ed0baabafd8bbb7d0b021e1fc24180c0
6:36:35 PM: Fetching cached dependencies
6:36:35 PM: Failed to fetch cache, continuing with build
6:36:35 PM: Starting to prepare the repo for build
6:36:36 PM: No cached dependencies found. Cloning fresh repo
6:36:36 PM: git clone https://github.com/Thr0TT1e/huddle_landing_page
6:36:37 PM: Preparing Git Reference refs/heads/master
6:36:37 PM: Found netlify.toml. Overriding site configuration
6:36:37 PM: Starting build script
6:36:37 PM: Installing dependencies
6:36:39 PM: Downloading and installing node v10.16.2...
6:36:40 PM: Downloading https://nodejs.org/dist/v10.16.2/node-v10.16.2-linux-x64.tar.xz...
6:36:40 PM: 
#####
6:36:40 PM:   7.8%
6:36:40 PM: 
###############################################################
6:36:40 PM: ######### 100.0%
6:36:40 PM: Computing checksum with sha256sum
6:36:40 PM: Checksums matched!
6:36:43 PM: Now using node v10.16.2 (npm v6.9.0)
6:36:44 PM: Attempting ruby version 2.6.2, read from environment
6:36:46 PM: Using ruby version 2.6.2
6:36:47 PM: Using PHP version 5.6
6:36:47 PM: Started restoring cached node modules
6:36:47 PM: Finished restoring cached node modules
6:36:47 PM: Installing NPM modules using NPM version 6.9.0
6:36:49 PM: npm
6:36:49 PM: WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
6:36:53 PM: npm WARN deprecated lodash.createcallback@2.4.4: This package is discontinued. Use lodash.iteratee@^4.0.0.
6:37:18 PM: > node-sass@4.12.0 install /opt/build/repo/node_modules/node-sass
6:37:18 PM: > node scripts/install.js
6:37:19 PM: Downloading binary from https://github.com/sass/node-sass/releases/download/v4.12.0/linux-x64-64_binding.node
6:37:21 PM: Download complete
6:37:21 PM: Binary saved to /opt/build/repo/node_modules/node-sass/vendor/linux-x64-64/binding.node
6:37:21 PM: Caching binary to /opt/buildhome/.npm/node-sass/4.12.0/linux-x64-64_binding.node
6:37:21 PM: > node-sass@4.12.0 postinstall /opt/build/repo/node_modules/node-sass
6:37:21 PM: > node scripts/build.js
6:37:22 PM: Binary found at /opt/build/repo/node_modules/node-sass/vendor/linux-x64-64/binding.node
6:37:22 PM: Testing binary
6:37:22 PM: Binary is fine
6:37:22 PM: > gifsicle@4.0.1 postinstall /opt/build/repo/node_modules/gifsicle
6:37:22 PM: > node lib/install.js
6:37:23 PM:   ✔ gifsicle pre-build test passed successfully
6:37:23 PM: > jpegtran-bin@4.0.0 postinstall /opt/build/repo/node_modules/jpegtran-bin
6:37:23 PM: > node lib/install.js
6:37:24 PM:   ✔ jpegtran pre-build test passed successfully
6:37:24 PM: > optipng-bin@5.1.0 postinstall /opt/build/repo/node_modules/optipng-bin
6:37:24 PM: > node lib/install.js
6:37:24 PM:   ✔ optipng pre-build test passed successfully
6:37:25 PM: npm
6:37:25 PM: notice created a lockfile as package-lock.json. You should commit this file.
6:37:25 PM: npm WARN
6:37:25 PM:  huddle-landing-page@0.0.1 No repository field.
6:37:25 PM: npm WARN optional
6:37:25 PM:  SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
6:37:25 PM: npm WARN
6:37:25 PM: notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
6:37:25 PM: added 925 packages from 552 contributors and audited 14495 packages in 37.17s
6:37:25 PM: found 0 vulnerabilities
6:37:26 PM: NPM modules installed
6:37:26 PM: Started restoring cached go cache
6:37:26 PM: Finished restoring cached go cache
6:37:26 PM: unset GOOS;
6:37:26 PM: unset GOARCH;
6:37:26 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
6:37:26 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
6:37:26 PM: go version >&2;
6:37:26 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
6:37:26 PM: go version go1.12 linux/amd64
6:37:26 PM: Installing missing commands
6:37:26 PM: Verify run directory
6:37:26 PM: Executing user command: gulp build
6:37:28 PM: [15:37:28]
6:37:28 PM: Using gulpfile /opt/build/repo/gulpfile.js
6:37:28 PM: [15:37:28]
6:37:28 PM: Task never defined: build
6:37:28 PM: [15:37:28]
6:37:28 PM: To list available tasks, try running: gulp --tasks
6:37:28 PM: Skipping functions preparation step: no functions directory set
6:37:28 PM: Caching artifacts
6:37:28 PM: Started saving node modules
6:37:28 PM: Finished saving node modules
6:37:28 PM: Started saving pip cache
6:37:28 PM: Finished saving pip cache
6:37:28 PM: Started saving emacs cask dependencies
6:37:28 PM: Finished saving emacs cask dependencies
6:37:28 PM: Started saving maven dependencies
6:37:28 PM: Finished saving maven dependencies
6:37:28 PM: Started saving boot dependencies
6:37:28 PM: Finished saving boot dependencies
6:37:28 PM: Started saving go dependencies
6:37:28 PM: Finished saving go dependencies
6:37:38 PM: Error running command: Build script returned non-zero exit code: 1
6:37:38 PM: Failing build: Failed to build site
6:37:38 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
6:37:38 PM: Finished processing build request in 1m3.374187994s

netlify.toml

# global context
[build]
  publish = "dist"
  command = "gulp build"
# build a preview (optional)
[context.deploy-preview]
  command = "gulp build-preview"
# build a branch with debug (optional)
[context.branch-deploy]
  command = "gulp build-debug"

gulpfile. js-https://github.com/Thr0TT1e/huddle_landing_page/blob/master/gulpfile.js文件格式
在Netlify上正确构建项目还需要什么设置?该项目是使用gulp构建的,我没有针对该程序集的特殊任务。

rvpgvaaj

rvpgvaaj1#

我不确定这是否是同一个问题,但是当我试图部署一个包含gulpfile的存储库时,我不断收到构建错误、404消息或没有css的站点。
如果您使用gulp来编译node_modules,就像我使用gulpfile.js运行gulp命令一样,那么您需要做的就是将app文件夹文件上传到存储库并部署该存储库。
https://themesberg.com/blog/tutorial/gulp-4-bootstrap-sass-browsersync
我在这个网站上安装了gulp以使用SASS和bootstrap。这让你建立了一个应用程序文件夹来存放编译后的gulp代码。你将把应用程序文件夹中的文件和文件夹上传到一个存储库并部署到netlify上。
下面是我的存储库的一个例子:https://github.com/alexgant/CITPT217-redesign-weiner-works〈--存放所有代码的仓库,包括gulpfile.js
https://github.com/alexgant/weinerworks〈--仅包含上述存储库中应用程序文件夹的存储库。
https://weinerworks-alexis-gantz.netlify.app/〈--这是我正在使用的Netlify站点,使用了列出的第二个存储库。

bcs8qyzn

bcs8qyzn2#

尝试在项目的根目录下添加一个netlify.toml文件。在该文件中添加一个指向根文件的路径。例如:

[[redirects]]
  from = "/"
  to = "/index.html"
  status = 200

相关问题