{"record":{"id":"fbcc26583e5fb3a8","repo":"nodejs/node","slug":"error-installing-the-data-library-n","errorCode":null,"errorMessage":"Error installing the data library.\\n","messagePattern":"Error installing the data library\\.\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/pkgdata/pkgdata.cpp","lineNumber":842,"sourceCode":"#endif\n                    if (result != 0) {\n                        fprintf(stderr, \"Error creating symbolic links of the data library file.\\n\");\n                        return result;\n                    }\n                }\n#endif\n            } /* !IN_STATIC_MODE */\n#endif\n\n#if !U_PLATFORM_USES_ONLY_WIN32_API\n            /* Install the libraries if option was set. */\n            if (o->install != nullptr) {\n                if(o->verbose) {\n                  fprintf(stdout, \"# Installing library file to %s ..\\n\", o->install);\n                }\n                result = pkg_installLibrary(o->install, targetDir, noVersion);\n                if (result != 0) {\n                    fprintf(stderr, \"Error installing the data library.\\n\");\n                    return result;\n                }\n            }\n#endif\n        }\n    }\n    return result;\n}\n\n/* Initialize the pkgDataFlags with the option file given. */\nstatic int32_t initializePkgDataFlags(UPKGOptions *o) {\n    UErrorCode status = U_ZERO_ERROR;\n    int32_t result = 0;\n    int32_t currentBufferSize = SMALL_BUFFER_MAX_SIZE;\n    int32_t tmpResult = 0;\n\n    /* Initialize pkgdataFlags */\n    pkgDataFlags = static_cast<char**>(uprv_malloc(sizeof(char*) * PKGDATA_FLAGS_SIZE));","sourceCodeStart":824,"sourceCodeEnd":860,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/pkgdata/pkgdata.cpp#L824-L860","documentation":"pkg_installLibrary() returned non-zero during the top-level install phase (line 840). This function copies the built data library to the install directory using the install command from pkgDataFlags[INSTALL_CMD], then creates symlinks. A failure here means the copy command or subsequent symlink creation failed.","triggerScenarios":"Called when o->install is non-null on non-Win32 platforms and the mode is not static (the static path is handled separately at line 753). The install command (typically 'cp' or 'install') for the versioned library file failed via system().","commonSituations":"Install directory doesn't exist or lacks write permissions; insufficient disk space; the versioned library file in targetDir is missing; INSTALL_CMD not set correctly in the options file.","solutions":["Create the install directory beforehand and verify write permissions.","Ensure the versioned library exists in the target directory before running pkgdata with --install.","Check pkgDataFlags[INSTALL_CMD] is a valid command ('install', 'cp', etc.).","Run the printed command manually to identify the OS-level error."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before installing, check the install directory exists and is writable\n#include <unistd.h>\n#include <sys/stat.h>\n\nbool checkInstallDir(const char* dir) {\n    struct stat st;\n    if (stat(dir, &st) != 0) return false;  // must exist\n    if (!S_ISDIR(st.st_mode)) return false;\n    if (access(dir, W_OK) != 0) return false;\n    return true;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create the install directory and set permissions before running pkgdata --install.","Verify the versioned library exists in the target directory.","Check pkgDataFlags[INSTALL_CMD] is valid."],"tags":["icu","pkgdata","install","permissions","build-tool"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}