{"id":25919,"library":"makensis","title":"node-makensis","description":"A TypeScript wrapper for the NSIS (Nullsoft Scriptable Install System) compiler, makensis. Current stable version is 3.0.5 (released 2025). Requires Node.js >=18 and NSIS >=3.06. Provides a promise-based API to compile installer scripts, retrieve version/help/license information, and manage compiler options like defines, verbose output, and environment variables. Ships TypeScript types. Supports Deno via JSR. Key differentiator: modern ESM-native library with full TypeScript typings, replacing raw child_process calls with a robust, type-checked interface. Maintained on GitHub, with regular updates and CI.","status":"active","version":"3.0.5","language":"javascript","source_language":"en","source_url":"https://github.com/idleberg/node-makensis","tags":["javascript","nsis","makensis","typescript"],"install":[{"cmd":"npm install makensis","lang":"bash","label":"npm"},{"cmd":"yarn add makensis","lang":"bash","label":"yarn"},{"cmd":"pnpm add makensis","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; named export, not default.","wrong":"import { default as compile } from 'makensis'","symbol":"compile","correct":"import { compile } from 'makensis'"},{"note":"ESM-only; require() will not work.","wrong":"const commandHelp = require('makensis').commandHelp","symbol":"commandHelp","correct":"import { commandHelp } from 'makensis'"},{"note":"Namespace import for all exports.","wrong":"import NSIS from 'makensis'","symbol":"NSIS (namespace)","correct":"import * as NSIS from 'makensis'"}],"quickstart":{"code":"import { compile } from 'makensis';\n\nconst options = {\n  verbose: 2,\n  define: {\n    SPECIAL_BUILD: true,\n    LANGUAGE: 'English'\n  }\n};\n\ntry {\n  const output = await compile('path/to/installer.nsi', options);\n  console.log('Compiler output:', output);\n} catch (error) {\n  console.error(error);\n}","lang":"typescript","description":"Compiles an NSIS installer script with custom defines and verbose logging using the promise-based API."},"warnings":[{"fix":"Install NSIS 3.06 or later (https://nsis.sourceforge.io/Download).","message":"makensis v3.0.0 broke support for NSIS <3.06. Maker must upgrade NSIS to at least 3.06.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Remove event listeners; use the returned Promise or the dedicated methods like compile().","message":"makensis v3.0.0 removed event support. Previously available events (e.g., 'data', 'error') are no longer emitted.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use the `env` option in compiler options to pass environment variables, or rely on process.env directly.","message":"makensis v3.0.0 removed support for .env files. Environment variables must be passed explicitly via the `env` option or process.env.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Upgrade Node.js to version 18 or later.","message":"makensis v3.0.0 requires Node.js >=18. Older Node versions are no longer supported.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Migrate to makensis@3 and upgrade NSIS to 3.06+.","message":"The `makensis@2` series is deprecated and only maintained for legacy NSIS support (<3.06).","severity":"deprecated","affected_versions":">=2.0.0 <3.0.0"},{"fix":"Set `pathToMakensis` in options to the full path of the makensis executable.","message":"If makensis is not in PATH, you must set the `pathToMakensis` option. Otherwise compile will fail with 'ENOENT'.","severity":"gotcha","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install NSIS and ensure makensis is in PATH, or set pathToMakensis option.","cause":"makensis executable not found in system PATH.","error":"Error: spawn makensis ENOENT"},{"fix":"Upgrade to makensis@3 and use the returned Promise values instead of events.","cause":"Using an outdated version (<3.0.0) that relies on events, but trying to access stdout directly.","error":"TypeError: Cannot read properties of undefined (reading 'stdout')"},{"fix":"Add \"type\": \"module\" to package.json, or use .mjs extension.","cause":"Running in a CommonJS context without configuring ESM (e.g., no 'type': 'module' in package.json).","error":"import { compile } from 'makensis'; SyntaxError: Cannot use import statement outside a module"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}