ValidationError: 'port' is required. (But I have one. πŸ€·β€β™‚οΈ)

Hello! Everything was working fine until recently, when a few updates to Netlify CLI seem to have introduced a new issue for me.

When I run ntl dev, I receive this message:

  Β± |master β†’ origin U:2 βœ—| β†’ ntl dev
  β—ˆ Netlify Dev β—ˆ

  β—ˆ Injected build setting env var:  [ALL_MY_SHIT]
  β—ˆ Starting Netlify Dev with undefined

  β—ˆ Lambda server is listening on 34567
  ValidationError: 'port' is required.
      at validateParameters (~/.npm-global/lib/node_modules/netlify-cli/node_modules/wait-port/lib/validate-parameters.js:13:20)
      at Promise (~/.npm-global/lib/node_modules/netlify-cli/node_modules/wait-port/lib/wait-port.js:183:9)
      at new Promise (<anonymous>)
      at waitPort (~/.npm-global/lib/node_modules/netlify-cli/node_modules/wait-port/lib/wait-port.js:173:10)
      at startProxy (~/.npm-global/lib/node_modules/netlify-cli/src/commands/dev/index.js:126:9)
      at DevCommand.run (~/.npm-global/lib/node_modules/netlify-cli/src/commands/dev/index.js:406:31)

And here is my .toml file, which hasn’t changed since:

[build]
  command='npm run init; gulp all'
  functions='lambda'
  publish='build'

[context.production]
  command='npm run init; gulp all -p'

[dev]
  command='gulp dev -dn'
  port=3000
  publish='build'

hi there, did you see this thread already?

Would you give it a try without setting the port and see what happens?

@perry unfortunately I get the same exact results when I leave the port out of my .toml

Hi @erikwoods, Thanks for writing in. I recommend opening an issue in the repo for the Netlify CLI. You can do this from Issues Β· netlify/cli Β· GitHub . You should be able to get help directly from our devs right there. Thanks.

1 Like

@futuregerald I’ve been meaning to do what you recommended in your last comment, but there have been a lot of releases since then (I was using 2.15.0), and I tried out the latest (2.20.2) and it’s working fine.

Edit: false alarm. I didn’t test it properly. I’ll log an issue for this.

:smiley: Thanks again.

1 Like