2

このリンクhttps://github.com/pi0/nuxt-plesk-exampleに従ってNuxtjs プロジェクトを Plesk 共有ホストにデプロイしますが、プロジェクトを本番モードで開始したいときにスクリプト コマンドを実行するstartと、このエラーが発生します 注: I ENV変数を設定しませんでした。

project-frontend@1.0.0 start /var/www/vhosts/[domain].org/[domain].org
> nuxt start


 FATAL  listen EADDRNOTAVAIL [domain]:8000

  at Server.setupListenHandle [as _listen2] (net.js:1343:19)
  at listenInCluster (net.js:1401:12)
  at GetAddrInfoReqWrap.doListen [as callback] (net.js:1510:7)
  at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:72:10)

tput: No value for $TERM and no -T specified

   ╭───────────────────────────────────────────────────╮
   │                                                   │
   │   ✖ Nuxt Fatal Error                              │
   │                                                   │
   │   Error: listen EADDRNOTAVAIL [domain]:8000   │
   │                                                   │
   ╰───────────────────────────────────────────────────╯

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! iwa-frontend@1.0.0 start: `nuxt start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the iwa-frontend@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /var/www/vhosts/[domain].org/.npm/_logs/2019-08-07T07_46_00_876Z-debug.log

これはserver.jsルートディレクトリにある私のファイルです

const express = require('express');
const { Nuxt, Builder } = require('nuxt');

const config = require('./nuxt.config.js');

// Create new express app
const app = express();

// Listen to port 3000 or PORT env if provided
app.listen(process.env.PORT || 8000);

// Enable production mode
config.dev = false;

// Create instance of nuxt
const nuxt = new Nuxt(config);

そしてこれは私のnuxt.config.js

import colors from "vuetify/es5/util/colors";

export default {
  mode: "universal",
  /*
   ** Headers of the page
   */
    server: {
    port: 8000, // default: 3000
    host: '[domain-name].org', // default: localhost
  },
  head: {
    meta: [
      { charset: "utf-8" },
      { name: "viewport", content: "width=device-width, initial-scale=1" },
      {
        hid: "description",
        name: "description",
        content: process.env.npm_package_description || ""
      }
    ],
    link: [
      { rel: "icon", type: "image/x-icon", href: "/favicon.ico" },
      {
        rel: "stylesheet",
        href:
          "https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons"
      }
    ]
  },
  /*
   ** Customize the progress-bar color
   */
  loading: { color: "#fff" },
  /*
   ** Global CSS
   */
  css: ["~/assets/main.css"],

  router: {
    middleware: "i18n"
  },
  /*
   ** Plugins to load before mounting the App
   */
  plugins: [
    "~/plugins/mdi-font.js",
    "~/plugins/i18n.js",
    "~/plugins/axios.js",
    { src: "~/plugins/flag.js", ssr: false }
  ],
  /*
   ** Nuxt.js modules
   */
  modules: [
    "@nuxtjs/vuetify",
    // Doc: https://axios.nuxtjs.org/usage
    "@nuxtjs/axios"
  ],
  /*
   ** Axios module configuration
   ** See https://axios.nuxtjs.org/options
   */
  axios: {},
  /*
   ** vuetify module configuration
   ** https://github.com/nuxt-community/vuetify-module
   */
  vuetify: {
    theme: {
      primary: colors.blue.darken2,
      accent: colors.grey.darken3,
      secondary: colors.amber.darken3,
      info: colors.teal.lighten1,
      warning: colors.amber.base,
      error: colors.deepOrange.accent4,
      success: colors.green.accent3
    }
  },
  /*
   ** Build configuration
   */
  build: {
    /*
     ** You can extend webpack config here
     */
    extend(config, ctx) {}
  }
};

私は何をすべきか?ありがとう

4

0 に答える 0