cli.fail

Practice this fail.

npm would like a word with your flag.

npm / Vite · Restart as often as you like

Read the error, choose a command, and learn
why it works. Nothing runs on your machine.

Browse all practice ↗

This trusted local project defines "dev": "vite". Its usual development port is occupied, and you want port 4100.

npm would like a word with your flag.

$ npm run dev

> vite

The usual port is already occupied.

How do you pass the port choice through npm to Vite?

3 attempts remaining

Read why this fix works

npm would like a word with your flag.

npm run dev -- --port 4100

The -- after the npm script name passes subsequent arguments to that script. Vite’s --port option chooses its listening port, so npm run dev -- --port 4100 supplies the option to Vite rather than consuming it as an npm option.

Practice rounds do not affect the daily score or local streak. Try today’s challenge, or choose another scenario.

Copy your result