You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some environments (e.g. behind firewalls, or with limited permissions to bind to ports) it might be desirable to change the port used.
Case in point - an environment that only allows an user to bind to ports from a specified range (2000 - 3000). Running yarn dev on a fresh new nuxt project:
$ yarn dev
yarn run v1.22.22
$ nuxt dev
Nuxt 3.11.2 with Nitro 2.9.6
...
ERROR [uncaughtException] listen EPERM: operation not permitted 127.0.0.1:45541 14:51:58
at Server.setupListenHandle [as _listen2] (node:net:1880:21)
at listenInCluster (node:net:1945:12)
at doListen (node:net:2109:7)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
Running yarn dev --no-fork seems to reveal the real issue:
$ yarn dev --no-fork
yarn run v1.22.22
$ nuxt dev --no-fork
Nuxt 3.11.2 with Nitro 2.9.6
....
ERROR Cannot start nuxt: Unable to find a random port on any host 14:53:32
at getRandomPort (node_modules/get-port-please/dist/index.mjs:335:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async getPort (node_modules/get-port-please/dist/index.mjs:313:21)
at async buildClient (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.Cz3sykDo.mjs:537:21)
at async bundle (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.Cz3sykDo.mjs:1586:3)
at async bundle (node_modules/nuxt/dist/index.mjs:5125:5)
at async Promise.all (index 1)
at async build (node_modules/nuxt/dist/index.mjs:5000:5)
at async Promise.all (index 1)
at async NuxtDevServer._load (node_modules/nuxi/dist/chunks/dev2.mjs:6924:5)
at async NuxtDevServer.load (node_modules/nuxi/dist/chunks/dev2.mjs:6811:7)
at async NuxtDevServer.init (node_modules/nuxi/dist/chunks/dev2.mjs:6806:5)
at async Object.run (node_modules/nuxi/dist/chunks/dev.mjs:195:7)
at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.9edf0930.mjs:1648:16)
at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.9edf0930.mjs:1639:11)
at async runMain$1 (node_modules/nuxi/dist/shared/nuxi.9edf0930.mjs:1777:7)
Additional information
Would you be willing to help implement this feature?
Describe the feature
Currently, according to
nuxt/packages/vite/src/client.ts
Lines 132 to 136 in 6a271e8
In some environments (e.g. behind firewalls, or with limited permissions to bind to ports) it might be desirable to change the port used.
Case in point - an environment that only allows an user to bind to ports from a specified range (2000 - 3000). Running
yarn dev
on a fresh new nuxt project:Running
yarn dev --no-fork
seems to reveal the real issue:Additional information
Final checks
The text was updated successfully, but these errors were encountered: