{"id":25647,"library":"google-closure-compiler-windows","title":"Closure Compiler - Windows Native","description":"Native Windows platform distribution of Google Closure Compiler, providing the Windows executable (closure-compiler.exe) for JavaScript compilation, optimization, and minification. Current stable version is 20260428.0.0, released daily from the Closure Compiler repository. This package is specific to Windows (x64) and is one of multiple platform-specific distributions (also macOS, Linux). It is intended to be installed automatically as a dependency of the main google-closure-compiler package, which selects the correct platform package. Key differentiators: uses the native Java-free binary for Windows, no JVM required, CLI-only.","status":"active","version":"20260428.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/ChadKillingsworth/closure-compiler-npm","tags":["javascript","compiler","optimizer","minifier","closure"],"install":[{"cmd":"npm install google-closure-compiler-windows","lang":"bash","label":"npm"},{"cmd":"yarn add google-closure-compiler-windows","lang":"bash","label":"yarn"},{"cmd":"pnpm add google-closure-compiler-windows","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Main distribution package that selects the correct platform-specific subpackage","package":"google-closure-compiler","optional":false}],"imports":[{"note":"This is a platform binary package, not a JavaScript module. It has no JavaScript exports. Install it only if you need to manually locate the Windows binary.","wrong":"import { compile } from 'google-closure-compiler-windows'","symbol":"google-closure-compiler-windows","correct":"import 'google-closure-compiler-windows'"},{"note":"Use the main package for the API. This package auto-selects the correct platform binary.","wrong":"import { compile } from 'google-closure-compiler-windows'","symbol":"google-closure-compiler","correct":"import { compile } from 'google-closure-compiler' or require('google-closure-compiler').compile"},{"note":"The BINARY constant gives the path to the platform-specific binary. It's available from the main package.","wrong":"require('google-closure-compiler-windows')","symbol":"compiler.BINARY","correct":"const compiler = require('google-closure-compiler'); console.log(compiler.BINARY)"}],"quickstart":{"code":"const { compile } = require('google-closure-compiler');\n\ncompile({\n  js: ['input.js'],\n  compilation_level: 'ADVANCED_OPTIMIZATIONS',\n  language_out: 'ECMASCRIPT5_STRICT',\n  warning_level: 'VERBOSE'\n}, (exitCode, stdOut, stdErr) => {\n  if (exitCode !== 0) {\n    console.error(stdErr);\n    process.exit(exitCode);\n  }\n  fs.writeFileSync('output.js', stdOut);\n});","lang":"javascript","description":"Minify a JavaScript file using the main google-closure-compiler package with ADVANCED_OPTIMIZATIONS, handling errors."},"warnings":[{"fix":"Install google-closure-compiler instead. This package is automatically installed as a dependency.","message":"This package only provides the Windows binary. It must be used via the main google-closure-compiler package, not directly.","severity":"gotcha","affected_versions":"all"},{"fix":"For macOS, use google-closure-compiler-darwin. For Linux, use google-closure-compiler-linux.","message":"The Windows binary requires Windows 64-bit. It will not work on 32-bit Windows or other OS.","severity":"gotcha","affected_versions":"all"},{"fix":"Pin to a specific version and test when upgrading.","message":"Version numbers mirror Closure Compiler releases (e.g., 20260428). Breaking changes may occur without major version bump.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install and require 'google-closure-compiler' instead.","cause":"You are trying to require this package directly, but it is not the main entry point.","error":"Cannot find module 'google-closure-compiler-windows'"},{"fix":"Ensure you have installed google-closure-compiler and not google-closure-compiler-java.","cause":"You are trying to run the Java-based version of Closure Compiler, but the Windows native package is meant to be used with the native binary.","error":"Error: jarfile not found"},{"fix":"Add node_modules/.bin to PATH or use npx google-closure-compiler.","cause":"The CLI command is not in PATH.","error":"The term 'closure-compiler' is not recognized"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}