nodejs/node · error
Error generating package data.
Error message
Error generating package data.
What it means
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.
Source
Thrown at deps/icu-small/source/tools/pkgdata/pkgdata.cpp:802
gencFilePath,
sizeof(gencFilePath),
true);
pkg_destroyOptMatchArch(optMatchArch);
#if U_PLATFORM_IS_LINUX_BASED
result = pkg_generateLibraryFile(targetDir, mode, gencFilePath);
#elif defined(WINDOWS_WITH_MSVC)
result = pkg_createWindowsDLL(mode, gencFilePath, o);
#endif
#elif defined(BUILD_DATA_WITHOUT_ASSEMBLY)
result = pkg_createWithoutAssemblyCode(o, targetDir, mode);
#else
fprintf(stderr, "Error- neither CAN_WRITE_OBJ_CODE nor BUILD_DATA_WITHOUT_ASSEMBLY are defined. Internal error.\n");
return 1;
#endif
}
if (result != 0) {
fprintf(stderr, "Error generating package data.\n");
return result;
}
}
#if !U_PLATFORM_USES_ONLY_WIN32_API
if(!IN_STATIC_MODE(mode)) {
/* Certain platforms uses archive library. (e.g. AIX) */
if(o->verbose) {
fprintf(stdout, "# Creating data archive library file ..\n");
}
result = pkg_archiveLibrary(targetDir, o->version, reverseExt);
if (result != 0) {
fprintf(stderr, "Error creating data archive library file.\n");
return result;
}
#if U_PLATFORM != U_PF_OS400
if (!noVersion) {
/* Create symbolic links for the final library file. */
#if U_PLATFORM == U_PF_OS390View on GitHub (pinned to 1b2de5e052)
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.
Defensive patterns
Strategy: validation
Validate before calling
// Before building, check that linker output directory is writable and has space
#include <sys/statvfs.h>
#include <unistd.h>
bool checkTargetDir(const char* dir) {
if (access(dir, W_OK) != 0) return false;
struct statvfs vfs;
if (statvfs(dir, &vfs) == 0 && vfs.f_bavail * vfs.f_bsize < 1048576) return false;
return true;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Error generating assembly code for data.
- -1
- Error creating data archive library file.
- Error creating symbolic links of the data library file.
- Error installing the data library.\n
AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13).
Data as JSON: /api/errors/cfb742f29ccb5c6d.
Report an issue: GitHub.