{"record":{"id":"cfb742f29ccb5c6d","repo":"nodejs/node","slug":"error-generating-package-data","errorCode":null,"errorMessage":"Error generating package data.\n","messagePattern":"Error generating package data\\.\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/pkgdata/pkgdata.cpp","lineNumber":802,"sourceCode":"                        gencFilePath,\n                        sizeof(gencFilePath),\n                        true);\n                    pkg_destroyOptMatchArch(optMatchArch);\n#if U_PLATFORM_IS_LINUX_BASED\n                    result = pkg_generateLibraryFile(targetDir, mode, gencFilePath);\n#elif defined(WINDOWS_WITH_MSVC)\n                    result = pkg_createWindowsDLL(mode, gencFilePath, o);\n#endif\n#elif defined(BUILD_DATA_WITHOUT_ASSEMBLY)\n                    result = pkg_createWithoutAssemblyCode(o, targetDir, mode);\n#else\n                    fprintf(stderr, \"Error- neither CAN_WRITE_OBJ_CODE nor BUILD_DATA_WITHOUT_ASSEMBLY are defined. Internal error.\\n\");\n                    return 1;\n#endif\n                }\n\n                if (result != 0) {\n                    fprintf(stderr, \"Error generating package data.\\n\");\n                    return result;\n                }\n            }\n#if !U_PLATFORM_USES_ONLY_WIN32_API\n            if(!IN_STATIC_MODE(mode)) {\n                /* Certain platforms uses archive library. (e.g. AIX) */\n                if(o->verbose) {\n                  fprintf(stdout, \"# Creating data archive library file ..\\n\");\n                }\n                result = pkg_archiveLibrary(targetDir, o->version, reverseExt);\n                if (result != 0) {\n                    fprintf(stderr, \"Error creating data archive library file.\\n\");\n                   return result;\n                }\n#if U_PLATFORM != U_PF_OS400\n                if (!noVersion) {\n                    /* Create symbolic links for the final library file. */\n#if U_PLATFORM == U_PF_OS390","sourceCodeStart":784,"sourceCodeEnd":820,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/pkgdata/pkgdata.cpp#L784-L820","documentation":"After generating object code via one of the platform-specific paths (pkg_generateLibraryFile on Linux, pkg_createWindowsDLL on MSVC, or pkg_createWithoutAssemblyCode), the result was non-zero. This is a generic catch-all for library file generation failures: linking errors, DLL creation failures, or individual data-file compilation errors.","triggerScenarios":"Calling pkgdata in DLL or common mode on a platform where the object code generation block is compiled in (CAN_WRITE_OBJ_CODE or BUILD_DATA_WITHOUT_ASSEMBLY defined), but the linker or DLL creation step failed. The underlying function that failed depends on the platform: pkg_generateLibraryFile on Linux, pkg_createWindowsDLL on Windows MSVC.","commonSituations":"Missing linker flags in the options file; unresolved symbols during linking; Windows DLL creation failing due to missing .def file or export configuration; insufficient disk space or permissions in the target directory.","solutions":["Examine stderr output immediately preceding this message for the underlying linker/compiler error.","Verify all object files exist and are non-empty in the target directory.","Check that pkgDataFlags[LDIBCFLAGS], pkgDataFlags[LDLIBRARYPATH], and linker flags are correct for the platform.","Ensure the target directory is writable and has enough disk space."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before building, check that linker output directory is writable and has space\n#include <sys/statvfs.h>\n#include <unistd.h>\n\nbool checkTargetDir(const char* dir) {\n    if (access(dir, W_OK) != 0) return false;\n    struct statvfs vfs;\n    if (statvfs(dir, &vfs) == 0 && vfs.f_bavail * vfs.f_bsize < 1048576) return false;\n    return true;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check linker flags in the options file before building.","Ensure all object files were generated in the prior step.","Run with verbose output to capture the underlying linker error."],"tags":["icu","pkgdata","linking","build-tool","platform"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}