nodejs/node · error

Error creating symbolic links. Failed command: %s\n

Error message

Error creating symbolic links. Failed command: %s\n

What it means

Inside pkg_createSymLinks() (line 1055), the primary symlink command failed. The command removes the major-version symlink and recreates it pointing to the full versioned library (e.g. 'cd targetDir && rm libX.so.76 && ln -s libX.so.76.1 libX.so.76'). runCommand() returned non-zero, meaning the shell command failed.

Source

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

    const char* FILE_EXTENSION_SEP = uprv_strlen(pkgDataFlags[SO_EXT]) == 0 ? "" : ".";

#if U_PLATFORM != U_PF_CYGWIN
    /* No symbolic link to make. */
    if (uprv_strlen(libFileNames[LIB_FILE_VERSION]) == 0 || uprv_strlen(libFileNames[LIB_FILE_VERSION_MAJOR]) == 0 ||
        uprv_strcmp(libFileNames[LIB_FILE_VERSION], libFileNames[LIB_FILE_VERSION_MAJOR]) == 0) {
        return result;
    }
    
    snprintf(cmd, sizeof(cmd), "cd %s && %s %s && %s %s %s",
            targetDir,
            RM_CMD,
            libFileNames[LIB_FILE_VERSION_MAJOR],
            LN_CMD,
            libFileNames[LIB_FILE_VERSION],
            libFileNames[LIB_FILE_VERSION_MAJOR]);
    result = runCommand(cmd);
    if (result != 0) {
        fprintf(stderr, "Error creating symbolic links. Failed command: %s\n", cmd);
        return result;
    }
#endif

    if (specialHandling) {
#if U_PLATFORM == U_PF_CYGWIN
        snprintf(name1, sizeof(name1), "%s", libFileNames[LIB_FILE_CYGWIN]);
        snprintf(name2, sizeof(name2), "%s", libFileNames[LIB_FILE_CYGWIN_VERSION]);
#elif U_PLATFORM == U_PF_OS390
        /* Create the symbolic links for the import data */
        /* Use the cmd buffer to store path to import data file to check its existence */
        snprintf(cmd, sizeof(cmd), "%s/%s", targetDir, libFileNames[LIB_FILE_OS390BATCH_VERSION]);
        if (T_FileStream_file_exists(cmd)) {
            snprintf(cmd, sizeof(cmd), "cd %s && %s %s && %s %s %s",
                    targetDir,
                    RM_CMD,
                    libFileNames[LIB_FILE_OS390BATCH_MAJOR],
                    LN_CMD,

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Run the printed command manually to see the shell-level error.
  2. Verify write permissions on targetDir.
  3. Ensure the versioned library file exists before symlink creation.
  4. Check that 'ln' and 'rm' are available in PATH on the build system.
Defensive patterns

Strategy: validation

Validate before calling

// Before symlink creation, verify write permissions and symlink support
#include <unistd.h>

bool verifySymlinkEnv(const char* targetDir, const char* sourceFile) {
    if (access(targetDir, W_OK) != 0) return false;
    char srcpath[1024];
    snprintf(srcpath, sizeof(srcpath), "%s/%s", targetDir, sourceFile);
    return access(srcpath, F_OK) == 0;
}

Prevention

When it happens

Trigger: Called from pkg_createSymLinks() on non-Cygwin platforms when both LIB_FILE_VERSION and LIB_FILE_VERSION_MAJOR are non-empty and differ. The 'rm' + 'ln -s' chain failed. This is the most common symlink creation path on Linux/macOS.

Common situations: Write permission denied in the target directory; the versioned source file doesn't exist; 'ln' or 'rm' not in PATH; target directory path has spaces or special characters not properly escaped; filesystem doesn't support symlinks.

Related errors


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