{"id":22712,"library":"vite-plugin-killer-instincts","title":"vite-plugin-killer-instincts","description":"A Vite plugin that detects when a process is already using the configured dev server port and optionally kills it. Version 1.1.0, works with Vite >=5.0.0. Key differentiator: integrates with Vite's `strictPort` to either throw a helpful error (default) or automatically terminate the blocking process (`autoKill: true`). Compatible with both ESM and CommonJS setups. Maintained by Wes Bos.","status":"active","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/wesbos/vite-plugin-killer-instincts","tags":["javascript","vite","vite-plugin","port","kill","strictPort","dev-server","typescript"],"install":[{"cmd":"npm install vite-plugin-killer-instincts","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-killer-instincts","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-killer-instincts","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency, required for plugin API","package":"vite","optional":false}],"imports":[{"note":"This package exports a default function, not a named export.","wrong":"import { killerInstincts } from 'vite-plugin-killer-instincts'","symbol":"default","correct":"import killerInstincts from 'vite-plugin-killer-instincts'"},{"note":"CJS require returns the default export directly.","wrong":"const { killerInstincts } = require('vite-plugin-killer-instincts')","symbol":"killerInstincts (default import in CommonJS)","correct":"const killerInstincts = require('vite-plugin-killer-instincts')"},{"note":"Use ESM import syntax; the package ships TypeScript types.","wrong":"import killerInstincts = require('vite-plugin-killer-instincts')","symbol":"default import with type assertion (TypeScript users)","correct":"import killerInstincts from 'vite-plugin-killer-instincts'"}],"quickstart":{"code":"// vite.config.ts\nimport { defineConfig } from 'vite';\nimport killerInstincts from 'vite-plugin-killer-instincts';\n\nexport default defineConfig({\n  server: {\n    port: 3000,\n    strictPort: true,\n  },\n  plugins: [\n    killerInstincts({\n      autoKill: true, // kills the blocking process automatically\n    }),\n  ],\n});","lang":"typescript","description":"Configure Vite to use the plugin with strictPort and autoKill enabled."},"warnings":[{"fix":"Ensure you have `server.strictPort: true` in your Vite config.","message":"The plugin only activates when `strictPort: true` is set in the Vite server config.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set `autoKill: true` if you want automatic process termination. Otherwise, manually run the suggested kill command.","message":"When `autoKill` is false (default), the plugin throws an error with instructions; it does not attempt to kill the process.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.1.0':27 '5.0.0':31 'alreadi':15 'autokil':52 'automat':47 'block':50 'bos':64 'commonj':59 'compat':54 'configur':18 'default':45 'detect':10 'dev':19,74 'dev-serv':73 'differenti':33 'either':40 'error':44 'esm':57 'help':43 'instinct':5 'integr':34 'javascript':65 'key':32 'kill':24,71 'killer':4 'maintain':61 'option':23 'plugin':3,8,69 'port':21,70 'process':13,51 'server':20,75 'setup':60 'strictport':38,72 'termin':48 'throw':41 'true':53 'typescript':76 'use':16 'version':26 'vite':2,7,30,36,66,68 'vite-plugin':67 'vite-plugin-killer-instinct':1 'wes':63 'work':28","created_at":"2026-04-27T17:06:37.736086+00:00","updated_at":"2026-04-27T17:06:37.736086+00:00","problems":[{"fix":"Set `autoKill: true` in plugin options, or run the displayed `kill -9 PID` command.","cause":"autoKill is set to false and port is occupied.","error":"Error: Port 3000 is already in use. Could not automatically kill process.\n\nRun `kill -9 PID` to manually kill the process."},{"fix":"Use `import killerInstincts from 'vite-plugin-killer-instincts'` (default import).","cause":"User tried to use a named import `{ killerInstincts }` instead of default import.","error":"[vite] Internal server error: killerInstincts is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/wesbos/vite-plugin-killer-instincts","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/vite-plugin-killer-instincts","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-18","next_check":"2026-07-26","install_tag":null}}