{"id":13205,"library":"full-icu","title":"Node.js Full ICU Data Installer","description":"The `full-icu` package, currently at version 1.5.0, provides a utility for Node.js environments configured with `small-icu` to enable full International Components for Unicode (ICU) data at runtime. This module became significantly less critical with Node.js 13 and later, which default to full ICU data, rendering `full-icu` largely unnecessary for modern applications unless using a custom Node.js build explicitly set to `small-icu`. Its release cadence is irregular, typically tied to maintenance or updates related to Node.js's ICU integration. Unlike other internationalization libraries, `full-icu` does not introduce new APIs; instead, it focuses solely on providing the underlying data necessary for Node.js's built-in `Intl` object to function with all locales, downloading it from GitHub releases or optionally the `icu4c-data` npm package. Its primary differentiator is simplifying the process of obtaining full ICU data without requiring a custom Node.js build, making it a tool primarily for specific legacy or specialized Node.js configurations.","status":"maintenance","version":"1.5.0","language":"javascript","source_language":"en","source_url":"https://github.com/nodejs/full-icu-npm","tags":["javascript","icu4c"],"install":[{"cmd":"npm install full-icu","lang":"bash","label":"npm"},{"cmd":"yarn add full-icu","lang":"bash","label":"yarn"},{"cmd":"pnpm add full-icu","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package primarily relies on its postinstall script for side-effects (installing ICU data) rather than imported functions. The `require` call returns an object containing Node.js and ICU version metadata, not a functional API. There are no named exports for direct import.","wrong":"import fullIcuMetadata from 'full-icu';","symbol":"full-icu metadata object","correct":"const fullIcuMetadata = require('full-icu');"},{"note":"This is a command-line utility installed by the package, not an importable JavaScript symbol. It prints the file system path to the installed `icudt*.dat` file.","wrong":"import { nodeFullIcuPath } from 'full-icu';","symbol":"node-full-icu-path CLI","correct":"npx node-full-icu-path"}],"quickstart":{"code":"import { execSync } from 'node:child_process';\n\n// Step 1: Check if your Node.js build uses 'small-icu'\nconst isSmallIcu = execSync('node -p \"process.config.variables.icu_small\"', { encoding: 'utf8' }).trim() === 'true';\n\nif (isSmallIcu) {\n  console.log('Your Node.js is built with small-icu. `full-icu` is relevant.');\n  console.log('To proceed, first install the package: npm install full-icu');\n\n  // Step 2: After `npm install full-icu` has completed successfully,\n  // you can require the package to get metadata and find the data path.\n  try {\n    const fullIcu = require('full-icu');\n    console.log('\\n--- full-icu metadata ---\\n', fullIcu);\n\n    const icuDataPath = execSync('node-full-icu-path', { encoding: 'utf8' }).trim();\n    console.log('\\n--- Full ICU data path ---\\n', icuDataPath);\n    console.log('\\nTo activate the data, ensure your Node.js instance is started with the --icu-data-dir flag pointing to this path, or set NODE_ICU_DATA.');\n  } catch (error) {\n    console.error('\\nError: Failed to retrieve full-icu metadata or path. Ensure `full-icu` is installed and its postinstall script ran successfully.', error.message);\n  }\n} else {\n  console.log('Your Node.js is built with full ICU. The `full-icu` package is not needed and will not have any useful effect.');\n}\n","lang":"javascript","description":"This quickstart first verifies if a Node.js environment is configured with 'small-icu', then demonstrates how to use the `full-icu` package to retrieve its metadata and the path to the installed ICU data file after installation."},"warnings":[{"fix":"Before installing, check `node -p 'process.config.variables.icu_small'` to see if your Node.js version is built with 'small-icu'. If it returns `false`, `full-icu` is not required.","message":"The `full-icu` package is generally not needed for Node.js versions 13 and later, as these versions ship with full ICU data by default. Using it on such versions will have no functional effect, though it is harmless.","severity":"gotcha","affected_versions":">=13.0.0"},{"fix":"Ensure `npm install` is run in an environment with network access and permissions to write files. Check `npm config get ignore-scripts` to ensure it's not set to `true`. Manual data placement or using the `FULL_ICU_PREFER_NPM=true` environment variable might be necessary if GitHub downloads are blocked.","message":"The package relies on a `postinstall` script to download and place the ICU data files. This script might fail due to network issues, restrictive environments, or if `npm` is configured to ignore `postinstall` scripts, leading to incomplete installation.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"If experiencing download issues or requiring data from the `icu4c-data` npm package, set the environment variable `FULL_ICU_PREFER_NPM=true` before running `npm install full-icu`.","message":"As of v1.4.0, `full-icu` changed its default behavior to pull ICU data files directly from ICU's GitHub releases instead of the `icu4c-data` npm module. While providing an environment variable (`FULL_ICU_PREFER_NPM=true`) to revert to the old behavior, this change might affect build pipelines or environments with strict GitHub access policies.","severity":"gotcha","affected_versions":">=1.4.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Run `npm install full-icu` to ensure the package is installed. Verify the `node_modules` directory is correctly configured and accessible by your Node.js application.","cause":"The package was not installed, or `npm install` failed to complete successfully, or the Node.js process cannot resolve the module path.","error":"Error: Cannot find module 'full-icu'"},{"fix":"Re-run `npm install full-icu`. Check the install logs for any errors related to the `postinstall` script. Ensure `npm`'s `bin` directory is in your PATH if running directly, or use `npx node-full-icu-path`.","cause":"The `node-full-icu-path` binary could not be found or executed, usually because the `postinstall` script failed to set up the ICU data, or the `full-icu` package was not fully installed.","error":"Command failed: node-full-icu-path"},{"fix":"No fix required, as the package is not needed. If you are on an older Node.js version and still see this, verify your Node.js build configuration by checking `node -p 'process.config.variables.icu_small'`.","cause":"This is not an error but a common user misapprehension. The user's Node.js version (typically Node.js 13 or newer) already includes full ICU data, rendering `full-icu` redundant.","error":"Node.js built with full ICU. `full-icu` is not needed and will not have any useful effect."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":""}