gpt4 book ai didi

javascript - Netlify 部署(Nuxt - Storyblok CMS 项目)失败。 `Failed during stage ' 建筑工地' : Build script returned non-zero exit code: 1`

转载 作者:行者123 更新时间:2023-12-02 23:30:11 26 4
gpt4 key购买 nike

解决了!请参阅下文了解更多详细信息。 (这是一个打字错误)

<小时/>




我正在尝试使用 npm rungenerate 在 Netlify 中将项目部署为静态,但在“构建站点”阶段出现失败的错误:构建脚本返回非零退出代码:1。我之前在 Netlify 中部署了另外 2 个项目(他们没有使用 Storyblok,仅使用 Nuxt),并且之前没有遇到过这样的错误。

该项目使用 Nuxt Js(Vue Js 框架)、Vuetify 和 Storyblok Headless CMS,并通过 asyncData 方法调用请求。我已经按照 Storyblok 的文档所述的方式实现了它,特别是在 nuxt.config.js 中生成路由,动态更改 版本(草案 - 已发布),使用用于请求的 storyblok-nuxt 模块,设置 Storyblok 空间并创建 token (草稿 - 已发布)、所需的组件和内容。

一切正常,无论是在本地使用 npm run dev (开发模式)还是使用 npm rungenerate (本地生产模式)。我使用 http-server 测试了第二个,它工作完全正常。

我尝试过:

1).甚至在没有缓存的情况下重新部署。

2).在本地运行 npm runaudit,然后运行 ​​npmrunauditfix 来修复一些漏洞(以检查它们是否是问题所在)。

3).将 Nuxt 更新到最新版本(我认为是 2.4.0,我更新到了 2.8.1。

4).我还尝试在 nuxt.config.js 中注释掉动态路由的生成(因此只会生成标准路由)以查看动态路由是否是问题所在,但仍然再次出现类似的错误。

Netlify 部署中的完整日志为:

8:04:24 PM: Build ready to start
8:04:26 PM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
8:04:26 PM: build-image tag: v3.3.2
8:04:26 PM: buildbot version: 75cd99f62ada9e21edea53208e8baf0eab85a045
8:04:26 PM: Fetching cached dependencies
8:04:26 PM: Starting to download cache of 255.0KB
8:04:26 PM: Finished downloading cache in 92.256738ms
8:04:26 PM: Starting to extract cache
8:04:26 PM: Failed to fetch cache, continuing with build
8:04:26 PM: Starting to prepare the repo for build
8:04:27 PM: No cached dependencies found. Cloning fresh repo
8:04:27 PM: git clone https://github.com/alexgil1994/sofokliskourtidis
8:04:28 PM: Preparing Git Reference refs/heads/master
8:04:28 PM: Starting build script
8:04:28 PM: Installing dependencies
8:04:29 PM: Downloading and installing node v10.16.0...
8:04:30 PM: Downloading https://nodejs.org/dist/v10.16.0/node-v10.16.0-linux-x64.tar.xz...
8:04:30 PM:
################################
8:04:30 PM: 44.9%
8:04:30 PM:
##################################################
8:04:30 PM: ###################### 100.0%
8:04:30 PM: Computing checksum with sha256sum
8:04:30 PM: Checksums matched!
8:04:33 PM: Now using node v10.16.0 (npm v6.9.0)
8:04:33 PM: Attempting ruby version 2.6.2, read from environment
8:04:34 PM: Using ruby version 2.6.2
8:04:35 PM: Using PHP version 5.6
8:04:35 PM: Started restoring cached node modules
8:04:35 PM: Finished restoring cached node modules
8:04:35 PM: Installing NPM modules using NPM version 6.9.0
8:04:59 PM: > core-js-pure@3.1.3 postinstall /opt/build/repo/node_modules/core-js-pure
8:04:59 PM: > node scripts/postinstall || echo "ignore"
8:04:59 PM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
8:04:59 PM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
8:04:59 PM: > https://opencollective.com/core-js
8:04:59 PM: > https://www.patreon.com/zloirock
8:04:59 PM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
8:04:59 PM: > nodemon@1.19.0 postinstall /opt/build/repo/node_modules/nodemon
8:04:59 PM: > node bin/postinstall || exit 0
8:04:59 PM: Love nodemon? You can now support the project via the open collective:
8:04:59 PM: > https://opencollective.com/nodemon/donate
8:04:59 PM: > nuxt@2.8.1 postinstall /opt/build/repo/node_modules/nuxt
8:04:59 PM: > opencollective || exit 0
8:05:00 PM: :-:
8:05:00 PM: .==-+:
8:05:00 PM: .==. :+- .-=-
8:05:00 PM: .==. :==++-+=.
8:05:00 PM: :==. -**: :+=.
8:05:00 PM: :+- :*+++. .++.
8:05:00 PM: :+- -*= .++: .=+.
8:05:00 PM: -+: =*- .+*: .=+:
8:05:00 PM: -+: .=*- .=*- =+:
8:05:00 PM: .==: .+*: -*- -+-
8:05:00 PM: .=+:.....:+*-.........:=*=..=*-
8:05:00 PM: .-=------=++============++====:
8:05:00 PM: Thanks for installing nuxtjs
8:05:00 PM: Please consider donating to our open collective
8:05:00 PM: to help us maintain this package.
8:05:00 PM: Number of contributors: 204
8:05:00 PM: Number of backers: 217
8:05:00 PM: Annual budget: $49,368
8:05:00 PM: Current balance: $10,815
8:05:00 PM: Donate: https://opencollective.com/nuxtjs/donate
8:05:01 PM: npm WARN
8:05:01 PM: optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 (node_modules/@nuxt/builder/node_modules/fsevents):
8:05:01 PM: npm
8:05:01 PM: WARN notsup
8:05:01 PM: SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
8:05:01 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
8:05:01 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
8:05:01 PM: added 1178 packages from 583 contributors and audited 13223 packages in 25.237s
8:05:01 PM: found 0 vulnerabilities
8:05:01 PM: NPM modules installed
8:05:01 PM: Started restoring cached go cache
8:05:01 PM: Finished restoring cached go cache
8:05:02 PM: unset GOOS;
8:05:02 PM: unset GOARCH;
8:05:02 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
8:05:02 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
8:05:02 PM: go version >&2;
8:05:02 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
8:05:02 PM: go version go1.12 linux/amd64
8:05:02 PM: Installing missing commands
8:05:02 PM: Verify run directory
8:05:02 PM: Executing user command: npm run generate
8:05:02 PM: > sofokliskourtidis@1.0.0 generate /opt/build/repo
8:05:02 PM: > nuxt generate
8:05:05 PM: ℹ Production build
8:05:05 PM: ✔ Builder initialized
8:05:05 PM: ✔ Nuxt files generated
8:05:08 PM: ℹ Compiling Client
8:05:57 PM: ✔ Client: Compiled with some errors in 49.73s
8:05:57 PM: Hash: e377ffadaa01340e2904
8:05:57 PM: Version: webpack 4.33.0
8:05:57 PM: Time: 49736ms
8:05:57 PM: Built at: 06/11/2019 5:05:57 PM
8:05:57 PM: Asset Size Chunks Chunk Names
8:05:57 PM: 05d6065413b138f1d7e5.js 11.9 KiB 8 pages/articles/posts/tags/_tag/page/_pageNum
8:05:57 PM: 0c60ef31c5ef98553702.js 6.12 KiB 38 pages/regional/posts/overview/index
8:05:57 PM: 11941b79ce20754bb795.js 1.65 KiB 31 pages/photography/posts/_id
8:05:57 PM: 14737906e17b8a20ffe4.js 4.83 KiB 9 pages/articles/posts/tags/index
8:05:57 PM: 16748f01034580cf9a1f.js 11.9 KiB 15 pages/literature-poetry/posts/search/page/_pageNum
8:05:57 PM: 16e42f3698c4cf474170.js 1.62 KiB 19 pages/movies/posts/_id
8:05:57 PM: 17399e159d7a5c9fd4ed.js 11.8 KiB 27 pages/music/posts/search/page/_pageNum
8:06:00 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
8:05:57 PM: 2cf93be146656923f6a9.js 1.69 KiB 13 pages/literature-poetry/posts/_id
8:05:57 PM: 300ad3ecf659adc49691.js 2.14 KiB 3 pages/about
8:05:57 PM: 498a6373a91c5639c50c.js 1.61 KiB 25 pages/music/posts/_id
8:06:01 PM: Shutting down logging, 104 messages pending

期望看到所有正在生成的路由(正常路由和动态路由),并且我相信崩溃发生在创建任何路由之前(这发生在生成的后期。另外我想说的是,当抛出的崩溃与每次重新部署都不一样,它发生在相似的地点和时间,但它也发生了显示类似这样的事情或(有点远)并且也更早但总是在客户端生成发生之后:

11:11:57 PM: Build ready to start
11:11:59 PM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
11:11:59 PM: build-image tag: v3.3.2
11:11:59 PM: buildbot version: 75cd99f62ada9e21edea53208e8baf0eab85a045
11:12:00 PM: Fetching cached dependencies
11:12:00 PM: Failed to fetch cache, continuing with build
11:12:00 PM: Starting to prepare the repo for build
11:12:00 PM: No cached dependencies found. Cloning fresh repo
11:12:00 PM: git clone https://github.com/alexgil1994/sofokliskourtidis
11:12:05 PM: Preparing Git Reference refs/heads/master
11:12:07 PM: Starting build script
11:12:07 PM: Installing dependencies
11:12:08 PM: Downloading and installing node v10.16.0...
11:12:09 PM: Downloading https://nodejs.org/dist/v10.16.0/node-v10.16.0-linux-x64.tar.xz...
11:12:09 PM:
################
11:12:09 PM: 22.7%
11:12:09 PM:
#########################################
11:12:09 PM: ################### 84.0%
11:12:09 PM:
######################################################################## 100.0%
11:12:09 PM: Computing checksum with sha256sum
11:12:09 PM: Checksums matched!
11:12:12 PM: Now using node v10.16.0 (npm v6.9.0)
11:12:12 PM: Attempting ruby version 2.6.2, read from environment
11:12:13 PM: Using ruby version 2.6.2
11:12:13 PM: Using PHP version 5.6
11:12:13 PM: Started restoring cached node modules
11:12:13 PM: Finished restoring cached node modules
11:12:14 PM: Installing NPM modules using NPM version 6.9.0
11:12:36 PM: > core-js-pure@3.1.3 postinstall /opt/build/repo/node_modules/core-js-pure
11:12:36 PM: > node scripts/postinstall || echo "ignore"
11:12:37 PM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
11:12:37 PM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
11:12:37 PM: > https://opencollective.com/core-js
11:12:37 PM: > https://www.patreon.com/zloirock
11:12:37 PM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
11:12:37 PM: > nodemon@1.19.0 postinstall /opt/build/repo/node_modules/nodemon
11:12:37 PM: > node bin/postinstall || exit 0
11:12:37 PM: Love nodemon? You can now support the project via the open collective:
11:12:37 PM: > https://opencollective.com/nodemon/donate
11:12:37 PM: > nuxt@2.8.1 postinstall /opt/build/repo/node_modules/nuxt
11:12:37 PM: > opencollective || exit 0
11:12:37 PM: :-:
11:12:37 PM: .==-+:
11:12:37 PM: .==. :+- .-=-
11:12:37 PM: .==. :==++-+=.
11:12:37 PM: :==. -**: :+=.
11:12:37 PM: :+- :*+++. .++.
11:12:37 PM: :+- -*= .++: .=+.
11:12:37 PM: -+: =*- .+*: .=+:
11:12:37 PM: -+: .=*- .=*- =+:
11:12:37 PM: .==: .+*: -*- -+-
11:12:37 PM: .=+:.....:+*-.........:=*=..=*-
11:12:37 PM: .-=------=++============++====:
11:12:37 PM: Thanks for installing nuxtjs
11:12:37 PM: Please consider donating to our open collective
11:12:37 PM: to help us maintain this package.
11:12:37 PM: Number of contributors: 204
11:12:37 PM: Number of backers: 217
11:12:37 PM: Annual budget: $49,368
11:12:37 PM: Current balance: $10,815
11:12:37 PM: Donate: https://opencollective.com/nuxtjs/donate
11:12:39 PM: npm
11:12:39 PM: WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 (node_modules/@nuxt/builder/node_modules/fsevents):
11:12:39 PM: npm WARN
11:12:39 PM: notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:12:39 PM: npm
11:12:39 PM: WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
11:12:39 PM: npm
11:12:39 PM: WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:12:39 PM: added 1178 packages from 583 contributors and audited 13223 packages in 24.18s
11:12:39 PM: found 0 vulnerabilities
11:12:39 PM: NPM modules installed
11:12:39 PM: Started restoring cached go cache
11:12:39 PM: Finished restoring cached go cache
11:12:39 PM: unset GOOS;
11:12:39 PM: unset GOARCH;
11:12:39 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
11:12:39 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
11:12:39 PM: go version >&2;
11:12:39 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
11:12:39 PM: go version go1.12 linux/amd64
11:12:39 PM: Installing missing commands
11:12:39 PM: Verify run directory
11:12:39 PM: Executing user command: npm run generate
11:12:39 PM: > sofokliskourtidis@1.0.0 generate /opt/build/repo
11:12:39 PM: > nuxt generate
11:12:42 PM: ℹ Production build
11:12:43 PM: ✔ Builder initialized
11:12:43 PM: ✔ Nuxt files generated
11:12:45 PM: ℹ Compiling Client
11:13:38 PM: ✔ Client: Compiled with some errors in 53.34s
11:13:38 PM: Hash: e377ffadaa01340e2904
11:13:38 PM: Version: webpack 4.33.0
11:13:38 PM: Time: 53344ms
11:13:38 PM: Built at: 06/11/2019 8:13:38 PM
11:13:38 PM: Asset Size Chunks Chunk Names
11:13:38 PM: 05d6065413b138f1d7e5.js 11.9 KiB 8 pages/articles/posts/tags/_tag/page/_pageNum
11:13:38 PM: 0c60ef31c5ef98553702.js 6.12 KiB 38 pages/regional/posts/overview/index
11:13:38 PM: 11941b79ce20754bb795.js 1.65 KiB 31 pages/photography/posts/_id
11:13:38 PM: 14737906e17b8a20ffe4.js 4.83 KiB 9 pages/articles/posts/tags/index
11:13:38 PM: 16748f01034580cf9a1f.js 11.9 KiB 15 pages/literature-poetry/posts/search/page/_pageNum
11:13:38 PM: 16e42f3698c4cf474170.js 1.62 KiB 19 pages/movies/posts/_id
11:13:38 PM: 17399e159d7a5c9fd4ed.js 11.8 KiB 27 pages/music/posts/search/page/_pageNum
11:13:38 PM: 2cf93be146656923f6a9.js 1.69 KiB 13 pages/literature-poetry/posts/_id
11:13:38 PM: 300ad3ecf659adc49691.js 2.14 KiB 3 pages/about
11:13:38 PM: 498a6373a91c5639c50c.js 1.61 KiB 25 pages/music/posts/_id
11:13:38 PM: 4e7c5059bd22566047bc.js 11.9 KiB 22 pages/movies/posts/tags/_tag/page/_pageNum
11:13:38 PM: 5703fdcb34c21e9010b9.js 6.02 KiB 20 pages/movies/posts/overview/index
11:13:38 PM: 590c5bb6b402a8e95872.js 6.25 KiB 10 pages/contact
11:13:38 PM: 5f172f247c5bdae3d529.js 11.8 KiB 21 pages/movies/posts/search/page/_pageNum
11:13:38 PM: 62aee38098ef0d84345a.js 12.6 KiB 4 pages/articles/index
11:13:38 PM: 62ca27f64ea11dbd388e.js 12.7 KiB 12 pages/literature-poetry/index
11:13:38 PM: 68570d73d3cc0726e0e1.js 11.8 KiB 33 pages/photography/posts/search/page/_pageNum
11:13:38 PM: 695064e2d97bbf093667.js 12.6 KiB 24 pages/music/index
11:13:38 PM: 69c29103b8a3228e38b8.js 113 KiB 1 app
11:13:38 PM: 6bee9e9833e8dfea8b0e.js 11.9 KiB 39 pages/regional/posts/search/page/_pageNum
11:13:38 PM: 6d59a37cdf09bf0bed9c.js 194 KiB 2 commons.app
11:13:38 PM: 6e556836004cc7d77285.js 65.6 KiB 46 vendors.pages/contact
11:13:38 PM: 715e27e7e7ebe62980e4.js 2.08 KiB 43 pages/termsconditions
11:13:38 PM: 8e3688fb9c457755f170.js 6.11 KiB 14 pages/literature-poetry/posts/overview/index
11:13:38 PM: 9b48190ec2f9aad78cda.js 3.09 KiB 42 pages/resume
11:13:42 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
11:13:38 PM: 9cd775f3c147971c7a28.js 12.6 KiB 30 pages/photography/index
11:13:38 PM: LICENSES 582 bytes
11:13:43 PM: Shutting down logging, 85 messages pending

相反,当我在本地运行 npm rungenerate 时,所有对 Storyblok 的请求(使用 Axios)都会创建所有预期的路由,而不会出现任何错误或警告。

我没有共享该存储库,因为它是一个私有(private)存储库并且内部有 token ,但如果需要任何信息,请告诉我。如果有任何想法可以尝试修复它,请启发我并感谢您的宝贵时间。

最佳答案

我找到了解决方案,它与 Nuxt、Storyblok 或其他任何东西都没有任何关系,这基本上是一个拼写错误。

我开始从不同地方的潜在 console.log(...) 中清理一些项目,想法是看看这样 Netlify 日志是否会给我更多信息详细信息,因为它们不会从 console.logs 中隐藏。

在清理和 git 推送之后,下一个部署确实在控制台中有更清晰的错误输出,这帮助我跟踪错误的位置。它位于一个 SectionImage SVG 组件中,该组件基本上与 Nuxt 的 SVG 模块一起使用,我将 name 属性编写为 Sectionimage。所以修复后一切都很完美!





(Nuxt - Vue - Vuetify 和 Storyblok(第一次使用它)摇滚!:D)

关于javascript - Netlify 部署(Nuxt - Storyblok CMS 项目)失败。 `Failed during stage ' 建筑工地' : Build script returned non-zero exit code: 1`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56549123/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com