我一直在尝试将带有 Sanity.io 后端的 Gatsby.js 博客部署到 Now。我使用这个模板(https://github.com/sanity-io/example-company-website-gatsby-sanity-combo)开始了这个项目,写了一些博客文章并尝试部署到现在。我在部署过程中遇到错误:
TaskID a56874b3-6d7f-4ecf-90d1-c5a05f3fe6ea
@zeit/now-dcs-info: using https://dcs.now.systems as the upstream
running yarn info for @now/build-utils...
running yarn info for @now/static-build...
running yarn for @now/build-utils...
yarn add v1.13.0
warning package.json: No license field
info No lockfile found.
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
warning No license field
success Saved 35 new dependencies.
info Direct dependencies
└─ @now/build-utils@0.5.1
info All dependencies
├─ @now/build-utils@0.5.1
├─ async-retry@1.2.3
├─ async-sema@2.1.4
├─ balanced-match@1.0.0
├─ brace-expansion@1.1.11
├─ buffer-crc32@0.2.13
├─ concat-map@0.0.1
├─ core-util-is@1.0.2
├─ double-ended-queue@2.1.0-0
├─ end-of-stream@1.4.1
├─ errno@0.1.7
├─ from2@2.3.0
├─ fs-extra@7.0.0
├─ fs.realpath@1.0.0
├─ glob@7.1.3
├─ graceful-fs@4.1.15
├─ inflight@1.0.6
├─ into-stream@5.0.0
├─ isarray@1.0.0
├─ jsonfile@4.0.0
├─ memory-fs@0.4.1
├─ minimatch@3.0.4
├─ multistream@2.1.1
├─ node-fetch@2.2.0
├─ p-is-promise@2.1.0
├─ path-is-absolute@1.0.1
├─ process-nextick-args@2.0.0
├─ prr@1.0.1
├─ readable-stream@2.3.6
├─ retry@0.12.0
├─ safe-buffer@5.1.2
├─ string_decoder@1.1.1
├─ universalify@0.1.2
├─ util-deprecate@1.0.2
└─ yazl@2.4.3
Done in 1.42s.
running yarn for @now/static-build...
yarn add v1.13.0
warning package.json: No license field
info No lockfile found.
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
warning No license field
success Saved 4 new dependencies.
info Direct dependencies
└─ @now/static-build@0.5.2
info All dependencies
├─ @now/static-build@0.5.2
├─ get-port@5.0.0
├─ promise-timeout@1.3.0
└─ type-fest@0.3.1
Done in 0.67s.
running builder.exports.build...
downloading user files...
installing to /tmp/2b1d07e4/web
running user "now-build" script from `package.json`...
running "npm run now-build"
> example-company-website-gatsby-sanity-combo-frontend@1.0.0 now-build /tmp/2b1d07e4/web
> npm run build
> example-company-website-gatsby-sanity-combo-frontend@1.0.0 build /tmp/2b1d07e4/web
> gatsby build
success open and validate gatsby-configs — 0.011 s
success load plugins — 0.197 s
success onPreInit — 0.516 s
success delete html and css files from previous builds — 0.009 s
success initialize cache — 0.009 s
success copy gatsby files — 0.030 s
warning [sanity] `overlayDrafts` is set to `true`, but no token is given
warning [sanity] Using `watchMode` when not in develop mode might prevent your build from completing
info [sanity] Fetching remote GraphQL schema
info [sanity] Stitching GraphQL schemas from SDL
success onPreBootstrap — 0.398 s
info [sanity] Fetching export stream for dataset
info [sanity] Watch mode enabled, starting a listener
info [sanity] Done exporting!
success source and transform nodes — 0.271 s
success building schema — 1.450 s
info Creating blog post page: /blog/2019/05/coding-a-design-system-part-one/
info Creating blog post page: /blog/2019/05/coding-a-design-system-part-two/
info Creating project page: /project/barclays-design-language/
success createPages — 0.323 s
success createPagesStatefully — 0.055 s
success onPreExtractQueries — 0.016 s
success update schema — 1.154 s
success extract queries from components — 0.298 s
success run graphql queries — 0.162 s — 12/12 74.77 queries/second
success write out page data — 0.004 s
success write out redirect data — 0.001 s
success onPostBootstrap — 0.001 s
info bootstrap finished - 7.409 s
success Building production JavaScript and CSS bundles — 23.259 s
success Building static HTML for pages — 4.967 s — 10/10 30.18 pages/second
info Done building in 35.64 sec
Error: Build was unable to create the distDir: public.
Make sure you mentioned the correct dist directory: https://zeit.co/docs/v2/deployments/official-builders/static-build-now-static-build/#configuring-the-build-output-directory
at validateDistDir (/tmp/utils/build-module/node_modules/@now/static-build/index.js:19:11)
at Object.exports.build (/tmp/utils/build-module/node_modules/@now/static-build/index.js:114:7)
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
我认为这可能是我读过的其他帖子中的一个常见问题,但我不确定接下来的步骤。有没有人成功解决了与此类似的问题,可以提供帮助?谢谢