nodejs/node · error

Error creating data archive library file.

Error message

Error creating data archive library file.

What it means

pkg_archiveLibrary() returned non-zero. On platforms where the shared object suffix (.so) differs from the final library suffix and the archive suffix (.a) matches the final suffix (e.g. AIX), pkgdata runs 'ar' and 'ranlib' to create an archive library. This error means one of those commands failed.

Source

Thrown at deps/icu-small/source/tools/pkgdata/pkgdata.cpp:814

                    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_OS390
                    result = pkg_createSymLinks(targetDir, o->pdsbuild);
#else
                    result = pkg_createSymLinks(targetDir, noVersion);
#endif
                    if (result != 0) {
                        fprintf(stderr, "Error creating symbolic links of the data library file.\n");
                        return result;
                    }
                }
#endif
            } /* !IN_STATIC_MODE */
#endif

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Verify 'ar' and 'ranlib' are installed and in PATH (pkgDataFlags[AR] and pkgDataFlags[RANLIB]).
  2. Check pkgDataFlags[ARFLAGS] contains valid flags for the platform's archiver.
  3. Ensure the source .so file exists in the target directory before archiving.
  4. Re-run configure to regenerate correct AR/ARFLAGS/RANLIB values for the platform.
Defensive patterns

Strategy: validation

Validate before calling

// Before building on AIX-like platforms, verify ar and ranlib exist
#include <unistd.h>

bool checkArchiverTools(const char* ar, const char* ranlib) {
    return access(ar, X_OK) == 0 && access(ranlib, X_OK) == 0;
}

Prevention

When it happens

Trigger: Only fires on non-static, non-Win32 platforms where pkgDataFlags[SOBJ_EXT] != pkgDataFlags[SO_EXT] and pkgDataFlags[A_EXT] == pkgDataFlags[SO_EXT]. The 'ar' command (pkgDataFlags[AR] with pkgDataFlags[ARFLAGS]) or the 'ranlib' command failed via system().

Common situations: On AIX: 'ar' not found in PATH; archive flags incorrect; the temporary library file to be archived doesn't exist; 'ranlib' not available or failing on the created archive.

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/3bc6dddd72dc9808. Report an issue: GitHub.