{"record":{"id":"6aec5f06162c8e56","repo":"nodejs/node","slug":"error-creating-symbolic-links-failed-command-s","errorCode":null,"errorMessage":"Error creating symbolic links. Failed command: %s\\n","messagePattern":"Error creating symbolic links\\. Failed command: (.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/pkgdata/pkgdata.cpp","lineNumber":1078,"sourceCode":"    const char* FILE_EXTENSION_SEP = uprv_strlen(pkgDataFlags[SO_EXT]) == 0 ? \"\" : \".\";\n\n#if U_PLATFORM != U_PF_CYGWIN\n    /* No symbolic link to make. */\n    if (uprv_strlen(libFileNames[LIB_FILE_VERSION]) == 0 || uprv_strlen(libFileNames[LIB_FILE_VERSION_MAJOR]) == 0 ||\n        uprv_strcmp(libFileNames[LIB_FILE_VERSION], libFileNames[LIB_FILE_VERSION_MAJOR]) == 0) {\n        return result;\n    }\n    \n    snprintf(cmd, sizeof(cmd), \"cd %s && %s %s && %s %s %s\",\n            targetDir,\n            RM_CMD,\n            libFileNames[LIB_FILE_VERSION_MAJOR],\n            LN_CMD,\n            libFileNames[LIB_FILE_VERSION],\n            libFileNames[LIB_FILE_VERSION_MAJOR]);\n    result = runCommand(cmd);\n    if (result != 0) {\n        fprintf(stderr, \"Error creating symbolic links. Failed command: %s\\n\", cmd);\n        return result;\n    }\n#endif\n\n    if (specialHandling) {\n#if U_PLATFORM == U_PF_CYGWIN\n        snprintf(name1, sizeof(name1), \"%s\", libFileNames[LIB_FILE_CYGWIN]);\n        snprintf(name2, sizeof(name2), \"%s\", libFileNames[LIB_FILE_CYGWIN_VERSION]);\n#elif U_PLATFORM == U_PF_OS390\n        /* Create the symbolic links for the import data */\n        /* Use the cmd buffer to store path to import data file to check its existence */\n        snprintf(cmd, sizeof(cmd), \"%s/%s\", targetDir, libFileNames[LIB_FILE_OS390BATCH_VERSION]);\n        if (T_FileStream_file_exists(cmd)) {\n            snprintf(cmd, sizeof(cmd), \"cd %s && %s %s && %s %s %s\",\n                    targetDir,\n                    RM_CMD,\n                    libFileNames[LIB_FILE_OS390BATCH_MAJOR],\n                    LN_CMD,","sourceCodeStart":1060,"sourceCodeEnd":1096,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/pkgdata/pkgdata.cpp#L1060-L1096","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run the printed command manually to see the shell-level error.","Verify write permissions on targetDir.","Ensure the versioned library file exists before symlink creation.","Check that 'ln' and 'rm' are available in PATH on the build system."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before symlink creation, verify write permissions and symlink support\n#include <unistd.h>\n\nbool verifySymlinkEnv(const char* targetDir, const char* sourceFile) {\n    if (access(targetDir, W_OK) != 0) return false;\n    char srcpath[1024];\n    snprintf(srcpath, sizeof(srcpath), \"%s/%s\", targetDir, sourceFile);\n    return access(srcpath, F_OK) == 0;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure write permission on the target directory.","Verify the versioned source file exists before symlink creation.","Test the 'ln -s' command manually if it fails."],"tags":["icu","pkgdata","symlink","shell-command","filesystem","build-tool"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}