It seems like you're encountering a port conflict because both of your Lando projects are trying to use the same port (3009). To resolve this, you need to assign different ports to each project. Here's how you can do it:
For your first project, you can keep the configuration as is:
// Lando file for Project 1
// ...
services:
node:
type: node:18
scanner: false
ports:
- 3009:3009
build:
- npm install
// ...
And for your Vite configuration in the first project:
// vite file for Project 1
//...
server: {
// ...
host: true,
port: 3009,
// ...
},
//...
For your second project, you need to change the ports in both the Lando configuration and the Vite configuration to a different port, for example, 3010:
// Lando file for Project 2
// ...
services:
node:
type: node:18
scanner: false
ports:
- 3010:3010
build:
- npm install
// ...
And for your Vite configuration in the second project:
// vite file for Project 2
//...
server: {
// ...
host: true,
port: 3010,
// ...
},
//...
By doing this, you ensure that each project listens on a different port, avoiding any conflicts. Remember to use these new port numbers when you're trying to access your projects in the browser.
After making these changes, you should be able to start both Lando servers without any port conflict errors. Make sure to restart Lando for the changes to take effect:
lando stop && lando start
Do this for both projects after you've updated their respective configurations.