I am trying to run a svelte project with the following command
> npm run dev
but I am getting this error
ERROR
Invalid command: dev
Run `$ svelte-kit --help` for more info.
svelte-kit is installed as dev dependency in my project, and my Package.json has a script defined.
{
"name": "xyz",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"test": "vitest",
"test:e2e": "playwright test"
},
"devDependencies": {
"@playwright/test": "^1.51.1",
"@sveltejs/adapter-auto": "^6.0.0",
"@sveltejs/kit": "^2.20.7",
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"autoprefixer": "^10.4.21",
"postcss": "^8.5.3",
"prettier": "^3.5.3",
"svelte": "^5.27.0",
"svelte-preprocess": "^6.0.3",
"tailwindcss": "^4.1.4",
"typescript": "^5.8.3",
"uuid": "^11.1.0",
"vite": "6.2.6",
"vitest": "^3.1.1"
}
}
I want to know what problems I am facing. Are there any issues with the dev dependencies?
dev
field defined in "scripts" block this won't work. For a default project itsvite dev
, so maybe give that a go ?could not resolve error during build : could not resolve enry module "index.html"
.vite.config.ts
, it should be looking forapp.html
instead ofindex.html
as an entry module. Make sure you have it configured to use the sveltekit plugin. You mind sharing it in the question as well?