netlify/cli

Netlify dev fails to acquire port. crashes after init.

ashesashes opened this issue · 0 comments

Describe the bug

Netlify dev fails to acquire port. crashes after init.
I did an lsof to make sure the port was available before running netlify dev. It opens, loads a function and then crashes with the message:
Could not acquire required 'port': '3002'
Command failed with exit code 1: npm run start. Shutting down Netlify Dev server

To repro, I first verified if there were ports free. then tried running netlify dev with the port numbers.
same result. "Could not acquire required 'port': 'PORT'"

Steps to reproduce

  1. check if port = 3000 is available
  2. run netlify dev --port=3002
  3. server starts, loads the functions and static files
  4. netlify dev server crashes and shows an error message.
  5. tried with other ports

can repro everytime.

Configuration

[build]
functions = "netlify/functions"
command = "npm run build"
publish = "public/"

[dev]
port = 3002
functions = "netlify/functions"
command = "npm run start"
publish = "public"
framework = "#static"
publicPath = "public"

Environment

System:
OS: macOS 12.5.1
CPU: (10) arm64 Apple M1 Pro
Memory: 291.48 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 21.5.0 - /opt/homebrew/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 10.2.4 - /opt/homebrew/bin/npm
npmGlobalPackages:
netlify-cli: 17.21.2