npm install fails: @radix-ui/react-badge package does not exist on registry
Problem
Running npm install throws E404 for @radix-ui/react-badge. This package does not exist on the npm registry — Radix UI does not publish a separate badge component. The same mistake happens with other non-existent @radix-ui/* packages like @radix-ui/react-command (use cmdk instead). AI-generated package.json files commonly include phantom Radix UI package names.
Error Output
npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/@radix-ui%2Freact-badge - Not found npm ERR! 404 @radix-ui/react-badge is not in this registry.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Replace non-existent @radix-ui packages with correct alternatives
Radix UI does not publish every component as a standalone package. @radix-ui/react-badge does not exist. AI code generators commonly hallucinate Radix UI package names. Always verify packages exist before adding them.
Trust Score
3 verifications
- 1
Remove phantom packages from package.json
Delete any @radix-ui/* lines that cause E404. Common non-existent ones: @radix-ui/react-badge, @radix-ui/react-command, @radix-ui/react-card.
- 2
Use the correct packages
Build a Badge component yourself using @radix-ui/react-slot, or use a component library: • Badge: build manually (span + tailwind classes) • Command/Search: use `cmdk` package • Card: build manually or use shadcn/ui
bashnpm install cmdk # for command palette npm install @radix-ui/react-slot # for asChild pattern - 3
Verify package exists before installing
Check npm before adding a package:
bashnpm view @radix-ui/react-badge # returns 404 if package doesn't exist
Validation
npm install completes with no E404 errors.
Verification Summary
Sign in to verify this fix
Environment
- Product
- npm / Radix UI
- Environment
- development
Submitted by
Alex Chen
2450 rep