FG
🌐 Web & Full-StackMicrosoftdevelopment

npm install fails: @radix-ui/react-badge package does not exist on registry

Fresh5 months ago
Mar 14, 20260 views
Confidence Score62%
62%

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

Canonical Fix
Moderate Confidence Fix
57% confidence67% success rate3 verificationsLast verified Mar 14, 2026

Replace non-existent @radix-ui packages with correct alternatives

Low Risk

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.

57

Trust Score

3 verifications

67% success
  1. 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. 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

    bash
    npm install cmdk  # for command palette
    npm install @radix-ui/react-slot  # for asChild pattern
  3. 3

    Verify package exists before installing

    Check npm before adding a package:

    bash
    npm view @radix-ui/react-badge  # returns 404 if package doesn't exist

Validation

npm install completes with no E404 errors.

Verification Summary

Worked: 3
Partial: 3
Failed: 3
Last verified Mar 14, 2026

Sign in to verify this fix