question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to change server PORT

See original GitHub issue

Environment

Nuxt CLI v3.0.0-27436017.7b6252a 11:33:31 RootDir: C:\devSandbox-Tom\DevFork-Tom\MAS-Auth\mas-auth-web3 11:33:34 Nuxt project info: 11:33:34


  • Operating System: Windows_NT
  • Node Version: v16.13.1
  • Nuxt Version: 3.0.0-27436017.7b6252a
  • Package Manager: npm@8.5.1
  • Bundler: Vite
  • User Config: typescript, server
  • Runtime Modules: -
  • Build Modules: -

Reproduction

I have tried several different coding methods as start-up scripts and nothing has worked. I have set .env PORT=4000

nuxt.config.ts import { defineNuxtConfig } from “nuxt3”;

// https://v3.nuxtjs.org/docs/directory-structure/nuxt.config export default defineNuxtConfig({ typescript: { shim: false, },

server: { port: process.env.PORT || 4000, }, });

Describe the bug

Common methods for setting the port for Nuxt2 do not work in Nuxt3. Nuxt3 will only run on port:3000

Additional context

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
TomMiller-mascommented, Mar 7, 2022

I found it!!! I was looking in all the wrong places.

http://v3.nuxtjs.org/getting-started/commands options.server from nuxt.config is not supported. You can use --port, --host, --https, --ssl-cert and --ssl-key instead.

"scripts": { "dev": "nuxi dev --port 4000",

0reactions
TomMiller-mascommented, Mar 6, 2022

That doesn’t work. I get the error that PORT is not a recognized command. I also modified the dev to "scripts": { "dev": "PORT=4000 nuxi dev", same error.

I also found this example for a node server SET PORT=8080 && node server.js but I have tried this in several different combinations of things and still doesn’t work. No error, but the server doesn’t start.

<< or load it into your shell in some other way >> I have looked and don’t see any way to do this. I can check for an open or active port, but I can’t set one.

If there is no reasonable easy viable way to set the PORT during development? I would consider that a bug. Just saying.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows server 2019 / Remote Desktop Gateway
When we tried to change default port number in RD Gateway manager - transport setting from 443 to something else. It is getting...
Read more >
Can not change ssh port | Server 16.04 - Ask Ubuntu
It should be /etc/ssh/sshd_config and you might want to restart the SSH service and open the new port your SSH Server is listening...
Read more >
Solved - I cannot change Server Port - SpigotMC
Hi, i had this problem (image). I can only enter the default port and not others. This is a permissions problem, how I...
Read more >
Cannot change port number - Visual Studio Feedback
I'm trying to lauch a website but the port number is in use (see iis1. png). Normally this should be easy fix, just...
Read more >
Changing the port numbers for the application server - IBM
Click Servers > Server Types > WebSphere Application Servers > server_name > Ports. Modify the value for WC_defaulthost with the new port number...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found