SvelteKit scripts fail: npm run build/dev = Invalid command, only sync works #14024
-
Describe the bugNote: This is NOT just a CLI interface question.
ReproductionSteps to reproduce Install Node.js v20.x (and also tested v18.x) Run: sh OR use an existing SvelteKit project (see below for package.json)npm install npm run build fails with Invalid command: build. Cleaning npm cache, trying different versions, and forcing reinstall does NOT help. Tried on DigitalOcean, local Windows 10, with clean npm cache and fresh folders. LogsWhat I've tried
Clean npm cache (npm cache clean --force)
Remove and reinstall all modules
Try multiple versions of @sveltejs/kit
Install from GitHub (#main, #master, #v2.25.1) — fails with git errors
Different servers, regions, and local PC (Windows 10)
Confirmed there is no global SvelteKit CLI installed System InfoSystem Info
Ubuntu 22.04/24.04 (DigitalOcean, NYC region)
Node.js v20.19.1
npm 10.x
Also reproduced on local Windows 10 PC
SvelteKit version: 2.25.1 Severityblocking all usage of SvelteKit Additional InformationOther npm packages/frameworks install and work fine This appears to be either a corrupted npm registry tarball, a CDN/mirror issue, or a broken SvelteKit publish (2025-07-20) Unable to use SvelteKit for new or existing projects in production This is currently blocking all new SvelteKit production deployments in my environment. Any advice or workaround appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Have you tried:
? I don't think |
Beta Was this translation helpful? Give feedback.
-
Only installing the packages doesn’t change/create new scripts in the package.json file |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
npm create svelte
has been deprecated for a long while. Thesvelte-kit build
command has been replaced withvite build
much earlier. Your PC probably has a cache for the older version. You should use the sv CLI instead.