How to edit HOST and PORT?

You can configure the PORT with 3 different ways:

  1. With env variables

    "scripts": {
     "dev": "HOST=0.0.0.0 PORT=3333 nuxt"
    }
  2. Add better cross platform development support.

    Note: for better cross platform development support you can use cross-env package.

    Installation:

    npm install --save-dev cross-env
    "scripts": {
     "dev": "cross-env HOST=0.0.0.0 PORT=3333 nuxt"
    }
  3. Via a nuxt config in the package.json:

    Inside your package.json:

    "config": {
     "nuxt": {
       "host": "0.0.0.0",
       "port": "3333"
     }
    },
    "scripts": {
     "dev": "nuxt"
    }

Caught a mistake or want to contribute to the documentation? Edit this page on GitHub!