- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的站点是使用 Gatsby 构建的,并持续部署到 Netlify。我已经两个月没有碰过我的 Gatsby 网站了。因此,当我运行更新并添加新内容并进行部署时,我在 Netlify 构建中遇到了一个重大错误。
已经尝试了很多东西并且已经花费了太多时间。最初我只使用 npm。在敲了一段时间之后,我按照一些在线线程的建议切换到 yarn。现在使用 yarn 获取不同的错误消息,但仍然无法部署到 Netlify。
这可能是一些愚蠢简单的事情。而且我知道我之前遇到过部署/构建问题并修复了它们,但是......我现在不知所措......
gatsby develop
和 gatsby build
都可以。gatsby build
命令master
和 switch-to-yarn
分支是一团糟。正在研究 PR #58解决这个部署问题注意:我还将此发布到 Reddit:https://www.reddit.com/r/gatsbyjs/comments/bnfqij/help_netlify_deploy_fails_on_gatsby_build/
这是尝试在 Netlify 上构建后的部署细节。我在代码块后面链接了一个屏幕截图,这样您就可以看到突出显示的错误。
10:42:15 PM: Build ready to start
10:42:18 PM: build-image version: 8e315e54bc4032a32e73290be556cde4f8348c12
10:42:18 PM: build-image tag: v2.8.2
10:42:18 PM: buildbot version: 1c5d5da2a8a19e94f07a53f82f5c9b010bad1249
10:42:18 PM: Fetching cached dependencies
10:42:18 PM: Failed to fetch cache, continuing with build
10:42:18 PM: Starting to prepare the repo for build
10:42:18 PM: No cached dependencies found. Cloning fresh repo
10:42:18 PM: git clone git@github.com:heyspacetime/spacetime-gatsby
10:42:22 PM: Preparing Git Reference pull/58/head
10:42:22 PM: Found netlify.toml. Overriding site configuration
10:42:22 PM: Starting build script
10:42:22 PM: Installing dependencies
10:42:23 PM: Downloading and installing node v8.16.0...
10:42:23 PM: Downloading https://nodejs.org/dist/v8.16.0/node-v8.16.0-linux-x64.tar.xz...
10:42:24 PM: 0.3%
10:42:24 PM:
###########
10:42:24 PM: 16.3%
10:42:24 PM:
##########################################################
10:42:24 PM: 81.6%
10:42:24 PM:
#######################################
10:42:24 PM: ################################# 100.0%
10:42:24 PM: Computing checksum with sha256sum
10:42:24 PM: Checksums matched!
10:42:26 PM: Now using node v8.16.0 (npm v6.4.1)
10:42:26 PM: Attempting ruby version 2.3.6, read from environment
10:42:27 PM: Using ruby version 2.3.6
10:42:28 PM: Using PHP version 5.6
10:42:28 PM: Started restoring cached node modules
10:42:28 PM: Finished restoring cached node modules
10:42:28 PM: Started restoring cached yarn cache
10:42:28 PM: Finished restoring cached yarn cache
10:42:28 PM: Installing yarn at version 1.5.1
10:42:28 PM: Installing Yarn!
10:42:28 PM: > Downloading tarball...
10:42:28 PM: [1/2]: https://yarnpkg.com/downloads/1.5.1/yar
10:42:28 PM: n-v1.5.1.tar.gz --> /tmp/yarn.tar.gz.unnZulZpgP
10:42:28 PM: % Total % Recei
10:42:28 PM: ved % Xferd Average Speed Time Time Time Curr
10:42:28 PM: ent
10:42:28 PM: Dload Upload Total Spent
10:42:28 PM: Left Speed
10:42:28 PM:
0
10:42:28 PM: 0 0 0 0 0 0 0 --:--:-- --:-
10:42:28 PM: -:-- --:--:-- 0
10:42:28 PM:
100 91 100 91 0 0 511
10:42:28 PM: 0 --:--:-- --:--:-- --:--:-- 514
10:42:28 PM:
0 0 0 608 0 0 1591 0 --:
10:42:28 PM: --:-- --:--:-- --:--:-- 1591
10:42:28 PM:
100 914k 100 914k 0 0 1226k 0 --:--:-- --:-
10:42:28 PM: -:-- --:--:-- 1226k
10:42:28 PM: [2/2]: https://yarnpkg.co
10:42:28 PM: m/downloads/1.5.1/yarn-v1.5.1.tar.gz.asc --> /tmp/yarn.tar.gz.unnZ
10:42:28 PM: ulZpgP.asc
10:42:29 PM:
100 95 100 95 0 0 2061 0 --:--:-
10:42:29 PM: - --:--:-- --:--:-- 2061
10:42:29 PM:
0 0 0 612 0 0 3939
10:42:29 PM: 0 --:--:-- --:--:-- --:--:-- 3939
10:42:29 PM:
0 832 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
10:42:29 PM:
100 832 100 832 0 0 3750
10:42:29 PM: 0 --:--:-- --:--:-- --:--:-- 812k
10:42:29 PM: > Verifying integrity...
10:42:29 PM: gpg: Signature made Mon 26 Feb 2018 07:01:19 PM UTC using RSA key ID B6FF4DE3
10:42:29 PM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>"
10:42:29 PM: gpg: Note: This key has expired!
10:42:29 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
10:42:29 PM: Subkey fingerprint: E219 30C4 D0A4 AA46 1858 1F7A E074 D16E B6FF 4DE3
10:42:29 PM: > GPG signature looks good
10:42:29 PM: > Extracting to ~/.yarn...
10:42:29 PM: > Adding to $PATH...
10:42:29 PM: > We've added the following to your /opt/buildhome/.profile
10:42:29 PM: > If this isn't the profile of your current shell then please add the following to your correct profile:
10:42:29 PM: export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
10:42:29 PM:
10:42:30 PM: > Successfully installed Yarn 1.5.1! Please open another terminal where the `yarn` command will now be available.
10:42:30 PM: Installing NPM modules using Yarn version 1.5.1
10:42:31 PM: yarn install v1.5.1
10:42:31 PM: [1/4] Resolving packages...
10:42:33 PM: [2/4] Fetching packages...
10:42:55 PM: info fsevents@1.2.9: The platform "linux" is incompatible with this module.
10:42:55 PM: info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
10:42:55 PM: [3/4] Linking dependencies...
10:42:55 PM: warning " > a11y-react-emoji@1.0.0" has incorrect peer dependency "react@16.7.0".
10:42:55 PM: warning "gatsby > pnp-webpack-plugin > ts-pnp@1.1.2" has unmet peer dependency "typescript@*".
10:42:55 PM: warning "gatsby-plugin-transition-link > babel-preset-gatsby-package > @babel/plugin-proposal-optional-chaining@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
10:42:55 PM: warning "gatsby-plugin-transition-link > babel-preset-gatsby-package > @babel/preset-flow@7.0.0" has unmet peer dependency "@babel/core@^7.0.0-0".
10:42:55 PM: warning "gatsby-plugin-transition-link > babel-preset-gatsby-package > @babel/plugin-proposal-optional-chaining > @babel/plugin-syntax-optional-chaining@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
10:43:05 PM: [4/4] Building fresh packages...
10:43:12 PM: success Saved lockfile.
10:43:12 PM: Done in 41.23s.
10:43:12 PM: NPM modules installed using Yarn
10:43:12 PM: Started restoring cached go cache
10:43:12 PM: Finished restoring cached go cache
10:43:12 PM: Installing Go version 1.10
10:43:18 PM: unset GOOS;
10:43:18 PM: unset GOARCH;
10:43:18 PM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64';
10:43:18 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64/bin:${PATH}";
10:43:18 PM: go version >&2;
10:43:18 PM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.10.linux.amd64.env"
10:43:18 PM: go version go1.10 linux/amd64
10:43:18 PM: Installing missing commands
10:43:18 PM: Verify run directory
10:43:18 PM: Executing user command: npm run build
10:43:18 PM: > Spacetime@1.0.0 build /opt/build/repo
10:43:18 PM: > gatsby build
10:43:20 PM: success open and validate gatsby-configs — 0.011 s
10:43:21 PM: success load plugins — 1.030 s
10:43:21 PM: success onPreInit — 0.118 s
10:43:21 PM: success delete html and css files from previous builds — 0.005 s
10:43:21 PM: success initialize cache — 0.008 s
10:43:21 PM: success copy gatsby files — 0.022 s
10:43:21 PM: success onPreBootstrap — 0.004 s
10:43:22 PM: success source and transform nodes — 0.413 s
10:43:22 PM: success building schema — 0.226 s
10:43:22 PM: success createPages — 0.018 s
10:43:22 PM: success createPagesStatefully — 0.072 s
10:43:22 PM: success onPreExtractQueries — 0.002 s
10:43:22 PM: success update schema — 0.024 s
10:43:22 PM: success extract queries from components — 0.078 s
10:43:22 PM: success run static queries — 0.001 s
10:43:22 PM: success run page queries — 0.019 s — 20/20 1114.65 queries/second
10:43:22 PM: success write out page data — 0.006 s
10:43:22 PM: success write out redirect data — 0.001 s
10:43:23 PM: success Build manifest and related icons — 0.776 s
10:43:23 PM: success onPostBootstrap — 0.778 s
10:43:23 PM: info bootstrap finished - 5.200 s
10:43:42 PM: error Generating JavaScript bundles failed
10:43:42 PM:
10:43:42 PM: Error: ./src/assets/stylesheets/styles.scss
10:43:42 PM: Module build failed (from ./node_modules/gatsby/node_modules/mini-css-extract- plugin/dist/loader.js):
10:43:42 PM: ModuleBuildError: Module build failed (from ./node_modules/sass-loader/lib/loa der.js):
10:43:42 PM: Error: ENOENT: no such file or directory, scandir '/opt/build/repo/node_module s/node-sass/vendor'
10:43:42 PM: at Object.fs.readdirSync (fs.js:904:18)
10:43:42 PM: at Object.getInstalledBinaries (/opt/build/repo/node_modules/node-sass/lib /extensions.js:131:13)
10:43:42 PM: at foundBinariesList (/opt/build/repo/node_modules/node-sass/lib/errors.js :20:15)
10:43:42 PM: at foundBinaries (/opt/build/repo/node_modules/node-sass/lib/errors.js:15: 5)
10:43:42 PM: at Object.module.exports.missingBinary (/opt/build/repo/node_modules/node- sass/lib/errors.js:45:5)
10:43:42 PM: at module.exports (/opt/build/repo/node_modules/node-sass/lib/binding.js:1 5:30)
10:43:42 PM: at Object.<anonymous> (/opt/build/repo/node_modules/node-sass/lib/index.js :14:35)
10:43:42 PM: at Module._compile (/opt/build/repo/node_modules/v8-compile-cache/v8-compi le-cache.js:178:30)
10:43:42 PM: at Object.Module._extensions..js (module.js:664:10)
10:43:42 PM: at Module.load (module.js:566:32)
10:43:42 PM: at tryModuleLoad (module.js:506:12)
10:43:42 PM: at Function.Module._load (module.js:498:3)
10:43:42 PM: at Module.require (module.js:597:17)
10:43:42 PM: at require (/opt/build/repo/node_modules/v8-compile-cache/v8-compile-cache .js:159:20)
10:43:42 PM: at Object.sassLoader (/opt/build/repo/node_modules/sass-loader/lib/loader. js:46:72)
10:43:42 PM: at runLoaders (/opt/build/repo/node_modules/gatsby/node_modules/webpack/li b/NormalModule.js:301:20)
10:43:42 PM: at /opt/build/repo/node_modules/loader-runner/lib/LoaderRunner.js:367:11
10:43:42 PM: at /opt/build/repo/node_modules/loader-runner/lib/LoaderRunner.js:233:18
10:43:42 PM: at runSyncOrAsync (/opt/build/repo/node_modules/loader-runner/lib/LoaderRu nner.js:143:3)
10:43:42 PM: at iterateNormalLoaders (/opt/build/repo/node_modules/loader-runner/lib/Lo aderRunner.js:232:2)
10:43:42 PM: at Array.<anonymous> (/opt/build/repo/node_modules/loader-runner/lib/Loade rRunner.js:205:4)
10:43:42 PM: at Storage.finished (/opt/build/repo/node_modules/enhanced-resolve/lib/Cac hedInputFileSystem.js:43:16)
10:43:42 PM: at provider (/opt/build/repo/node_modules/enhanced-resolve/lib/CachedInput FileSystem.js:79:9)
10:43:42 PM: at /opt/build/repo/node_modules/graceful-fs/graceful-fs.js:90:16
10:43:42 PM: at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
10:43:42 PM: @ ./src/components/layout.js 6:0-43
10:43:42 PM: @ ./src/pages/services/technical-seo.js
10:43:42 PM: @ ./.cache/async-requires.js
10:43:42 PM: @ ./.cache/production-app.js
10:43:42 PM:
10:43:42 PM: npm
10:43:42 PM: ERR! code ELIFECYCLE
10:43:42 PM: npm ERR!
10:43:42 PM: errno 1
10:43:42 PM: npm
10:43:42 PM: ERR! Spacetime@1.0.0 build: `gatsby build`
10:43:42 PM: npm ERR! Exit status 1
10:43:42 PM: npm ERR!
10:43:42 PM: npm ERR! Failed at the Spacetime@1.0.0 build script.
10:43:42 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
10:43:43 PM: npm
10:43:43 PM: ERR! A complete log of this run can be found in:
10:43:43 PM: npm ERR! /opt/buildhome/.npm/_logs/2019-05-11T03_43_42_997Z-debug.log
10:43:43 PM: Skipping functions preparation step: no functions directory set
10:43:43 PM: Caching artifacts
10:43:43 PM: Started saving node modules
10:43:43 PM: Finished saving node modules
10:43:43 PM: Started saving yarn cache
10:43:43 PM: Finished saving yarn cache
10:43:43 PM: Started saving pip cache
10:43:43 PM: Finished saving pip cache
10:43:43 PM: Started saving emacs cask dependencies
10:43:43 PM: Finished saving emacs cask dependencies
10:43:43 PM: Started saving maven dependencies
10:43:43 PM: Finished saving maven dependencies
10:43:43 PM: Started saving boot dependencies
10:43:43 PM: Finished saving boot dependencies
10:43:43 PM: Started saving go dependencies
10:43:44 PM: Finished saving go dependencies
10:43:46 PM: Error running command: Build script returned non-zero exit code: 1
10:43:46 PM: Failing build: Failed to build site
10:43:46 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
10:43:46 PM: Finished processing build request in 1m28.562451072s
10:43:46 PM: Shutting down logging, 0 messages pending
https://user-images.githubusercontent.com/4457883/57573280-f61abe00-73ea-11e9-8aa9-673f32572202.png
我希望 Gatsby 站点能够在部署到 Netlify 的基础上构建。 master
分支是我的生产站点,但 Netlify 也为分支创建测试版本。
最佳答案
您是否尝试过让 Netlify 清除缓存并重建?这个错误看起来你的怀疑是正确的,它没有安装 node-sass
。
如果您转到 Netlify 仪表板 > 部署,应该有一个“触发器部署”下拉菜单为您提供此选项。
如果这不起作用,请尝试删除 yarn.lock
并再次安装依赖项以使 Netlify 提取所有内容的新副本。
关于reactjs - Gatsby 构建在 Netlify 部署上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56102455/
我在使用以下代码时遇到问题: function http_file_exists($url){ $f=fopen($url,"r"); if($f){ fclose($f); retu
我已经通过 Git 部署到 Azure 几个月了,没有出现重大问题,但现在我似乎遇到了一个无法克服的错误。 我创建了一个新的 Azure 网站,为正在开发的项目创建单独的预览链接。我在新站点上设置了
我已经通过flutter创建了一个App并完成了它,我想在flutter文档中阅读时进行部署。 我收到此错误: FAILURE: Build failed with an exception. * W
我在Windows 10中使用一些简单的Powershell代码遇到了这个奇怪的问题,我认为这可能是我做错了,但我不是Powershell的天才。 我有这个: $ix = [System.Net.Dn
我正在尝试使用 RapidJSON 解析从服务器接收到的数据。以下是收到的确切字符串: [ { "Node": "9478149a08f9", "Address": "172.17
我尝试为 ios 编译 OpenCV。我总是收到这些错误。我用不同版本的opencv试了一下,结果都是一样的。 我运行这个:python 平台/ios/build_framework.py ios_o
我在一台机器上做基本的发布/订阅,我的客户端是 StackExchange-Redis 的 C# 客户端,我在同一台机器上运行基于 Windows 的 Redis 服务器(服务器版本 2.8.4) 当
我有这段代码,但无法执行,请帮我解决这个问题 连接 connect_error) { die ("connection failed: " . $terhubung->connect_erro
我在 tomcat 上运行并由 maven 编译的 Web 应用程序给出了以下警告和错误。我可以在本地存储库中看到所有 JAR,但有人可以帮忙吗。 WARNING: Failed to scan JA
我正在 Windows 8 上使用 Android Studio 开发一个 android 应用程序,我正在使用一些 native 代码。突然间我无法编译我的 C 文件。当我运行 ndk-build
下面的代码对类和结构的成员进行序列化和反序列化。序列化工作正常,但我在尝试使用 oarch >> BOOST_SERIALIZATION_NVP(outObj); 反序列化时遇到了以下错误; 代码中是
如果我运行此命令“rspec ./spec/requests/api/v1/password_reset_request_spec.rb”,此文件中的所有测试都会通过。 但是,当我运行“rspec”时
我在尝试执行测试以使用 Protractor 上传文件时出错,我的代码是这个 it('it should be possible to upload a file', function() {
System.loadLibrary("nativefaceswap"); 当我运行我的应用程序时,我在 Android Studio 中发现了此类错误。在logcat中显示: java.lang.U
我希望有人能帮助我!使用任何方法或命令行的任何 SSL/HTTPS 调用均无效。 我在 Windows 10 中使用 Ubuntu Server 18.04 作为子系统。我的问题是昨天才开始出现的,因
通过删除这两个值将日期字段从 null=True 和 Blank=True 更改为 required 时,使用 db.alter 命令时遇到问题。 当以下行被注释掉时,迁移运行不会出现问题。
我第一次使用 Heroku 尝试创建应用程序(使用 SendGrid 的 Inbound Parse Webhook"和 Twilio SMS 通过电子邮件发送和接收 SMS 消息)。通过 Virtu
我正在将我的 swift 项目更新到 Xcode 7 上的 Swift 2.0。xcode 在构建项目时报告了以下错误: 命令/Applications/Xcode.app/Contents/Deve
在我的代码中,SSL 库函数 SSL_library_init() 没有按预期返回 1。我如何才能看到它返回了什么错误? 我在 SSL_library_init() 之后调用了 SSL_load_er
我正在尝试运行在以下链接中找到的答案: Asynchronously Load the Contents of a Div 但是当我这样做时,我会遇到我不太理解的错误。 我的代码: $(documen
我是一名优秀的程序员,十分优秀!