{"id":18817,"library":"spectral-cli-bundle","title":"Spectral CLI Bundle","description":"Bundled version of @stoplight/spectral-cli v1.0.8 providing a self-contained executable for API linting with Spectral, pre-packaged to avoid external dependencies. Requires Node.js >=20. Released under MIT license, updated infrequently (last release 2023). Differentiator: single-file distribution, no need for npm install or separate Spectral CLI setup.","status":"active","version":"1.0.8","language":"javascript","source_language":"en","source_url":"https://github.com/silverwind/spectral-cli-bundle","tags":["javascript"],"install":[{"cmd":"npm install spectral-cli-bundle","lang":"bash","label":"npm"},{"cmd":"yarn add spectral-cli-bundle","lang":"bash","label":"yarn"},{"cmd":"pnpm add spectral-cli-bundle","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core Spectral CLI functionality is bundled.","package":"@stoplight/spectral-cli","optional":false}],"imports":[{"note":"ESM-only since v1.0.0; CommonJS require will fail.","wrong":"const spectral = require('spectral-cli-bundle')","symbol":"spectral","correct":"import { spectral } from 'spectral-cli-bundle'"},{"note":"Package re-exports all symbols from @stoplight/spectral-cli; use 'spectral-cli-bundle' as the import source.","wrong":"import { Spectral } from '@stoplight/spectral-cli'","symbol":"Spectral","correct":"import { Spectral } from 'spectral-cli-bundle'"}],"quickstart":{"code":"import { spectral } from 'spectral-cli-bundle';\n\nconst result = await spectral.run({\n  args: ['lint', '--format', 'stylish', 'api.yaml'],\n  stdout: process.stdout,\n  stderr: process.stderr\n});\n\nconsole.log('Exit code:', result.exitCode);","lang":"typescript","description":"Lints an OpenAPI specification file using Spectral CLI bundle and prints the exit code."},"warnings":[{"fix":"Upgrade Node.js to version 20 or later.","message":"package requires Node.js >=20, older versions will fail to run","severity":"breaking","affected_versions":"<20"},{"fix":"Replace all imports from '@stoplight/spectral-cli' with 'spectral-cli-bundle'.","message":"import must be from 'spectral-cli-bundle' not '@stoplight/spectral-cli'","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Convert require() to import statement or use dynamic import() if needed.","message":"CommonJS require() is not supported; use ESM import","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use import instead: import { spectral } from 'spectral-cli-bundle'; or use dynamic import()","cause":"Use of CommonJS require() with an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/spectral-cli-bundle/index.js from /path/to/file.js not supported."},{"fix":"Change import source to 'spectral-cli-bundle'.","cause":"Imported from wrong package (e.g., '@stoplight/spectral-cli') instead of 'spectral-cli-bundle'.","error":"TypeError: Cannot read properties of undefined (reading 'run')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}