【问题标题】:Unable to deploy nuxt app to digital ocean health checks无法将 nuxt 应用程序部署到数字海洋健康检查
【发布时间】:2021-11-07 12:11:03
【问题描述】:

我创建了一个简单且基本的 nuxt 应用程序,然后从终端,我将它推送到了 github repo。然后我确实将我的回购链接到数字海洋应用程序功能,以便它部署它。构建成功但启动未启动,我收到以下错误

Deploy Error: Health Checks
Common Causes
App is running slower than expected
Component Issues
apptest - failed to deploy

请注意,我没有配置环境变量,我将其保留为默认设置。这样做重要吗?

编辑:这里是 nuxt js 配置

export default {
  // Global page headers: https://go.nuxtjs.dev/config-head
  head: {
    title: 'apptest',
    htmlAttrs: {
      lang: 'en'
    },
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' },
      { name: 'format-detection', content: 'telephone=no' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: [
  ],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [
  ],

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [
  ],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: [
    // https://go.nuxtjs.dev/bootstrap
    'bootstrap-vue/nuxt',
  ],

  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
  }
}

数字海洋日志卡在这里

[appnuxt] [2021-09-11 10:47:59] yarn run v1.22.11
[appnuxt] [2021-09-11 10:47:59] $ nuxt start
[appnuxt] [2021-09-11 10:48:01] ℹ Listening on: http://localhost:8080/

【问题讨论】:

  • 你有一些环境变量吗?如果没有,则无需设置。另外,您的应用程序是否在本地成功构建?你是用yarn build 然后yarn start 构建它吗?
  • 是的,没有任何问题!
  • 构建命令呢?你能把你的nuxt.config.js文件分享给我们吗?
  • 令人沮丧的是,我不断收到错误......但我根本没有编辑应用程序。我所做的只是创建应用程序然后将其推送到 github。之后我去做了数字海洋来链接回购
  • 我通过开票解决了这个问题。支持将我重定向到此链接digitalocean.com/community/questions/…

标签: node.js vue.js deployment nuxt.js digital-ocean


【解决方案1】:

这篇文章帮助我完成了 Nuxt.js 应用程序的先前设置: Deploy Nuxt.js on DigitalOcean App Platform

正如那里提到的,它需要设置运行命令并为应用程序指定主机/端口(默认情况下它在 http://localhost:3000 上启动):

npm start -- --hostname 0.0.0.0 --port 8080

【讨论】:

    猜你喜欢
    • 2021-01-08
    • 1970-01-01
    • 2016-05-30
    • 2016-07-22
    • 2022-12-17
    • 1970-01-01
    • 1970-01-01
    • 2017-12-12
    • 2020-06-12
    相关资源
    最近更新 更多