{"record":{"id":"b5a03dafe39f9a5b","repo":"nodejs/node","slug":"failed-to-install-data-file-with-command-s-n","errorCode":null,"errorMessage":"Failed to install data file with command: %s\\n","messagePattern":"Failed to install data file with command: (.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/pkgdata/pkgdata.cpp","lineNumber":1238,"sourceCode":"\n    if (!T_FileStream_file_exists(installDir)) {\n        UErrorCode status = U_ZERO_ERROR;\n\n        uprv_mkdir(installDir, &status);\n        if (U_FAILURE(status)) {\n            fprintf(stderr, \"Error creating installation directory: %s\\n\", installDir);\n            return -1;\n        }\n    }\n#ifndef U_WINDOWS_WITH_MSVC\n    snprintf(cmd, sizeof(cmd), \"%s %s %s\", pkgDataFlags[INSTALL_CMD], fileName, installDir);\n#else\n    snprintf(cmd, sizeof(cmd), \"%s %s %s %s\", WIN_INSTALL_CMD, fileName, installDir, WIN_INSTALL_CMD_FLAGS);\n#endif\n\n    result = runCommand(cmd);\n    if (result != 0) {\n        fprintf(stderr, \"Failed to install data file with command: %s\\n\", cmd);\n    }\n\n    return result;\n}\n\n#ifdef U_WINDOWS_MSVC\n/* Copy commands for installing the raw data files on Windows. */\n#define WIN_INSTALL_CMD \"xcopy\"\n#define WIN_INSTALL_CMD_FLAGS \"/E /Y /K\"\n#endif\nstatic int32_t pkg_installFileMode(const char *installDir, const char *srcDir, const char *fileListName) {\n    int32_t result = 0;\n    char cmd[LARGE_BUFFER_MAX_SIZE] = \"\";\n\n    if (!T_FileStream_file_exists(installDir)) {\n        UErrorCode status = U_ZERO_ERROR;\n\n        uprv_mkdir(installDir, &status);","sourceCodeStart":1220,"sourceCodeEnd":1256,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/pkgdata/pkgdata.cpp#L1220-L1256","documentation":"In pkg_installCommonMode() (line 1217), the data file copy command failed. After successfully creating or verifying the install directory, the tool builds an install command using pkgDataFlags[INSTALL_CMD] (or WIN_INSTALL_CMD 'xcopy' on Windows MSVC) to copy a data file. runCommand() returned non-zero.","triggerScenarios":"Called from pkg_installCommonMode() during file-mode or common-mode installation of raw data files. The copy command (cp, install, or xcopy on Windows) for an individual data file to the install directory failed.","commonSituations":"Source data file doesn't exist; install directory permissions changed; on Windows MSVC, WIN_INSTALL_CMD ('xcopy') or its flags (/E /Y /K) are incompatible with the scenario; disk full; network drive timeout on the install path.","solutions":["Verify the source data file (fileName) exists before the install command runs.","Check write permissions on the install directory.","On Windows MSVC, verify 'xcopy' is available and the flags are appropriate.","Run the printed command manually to identify the OS-level error."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before installing data files, verify source file and dest directory\n#include <unistd.h>\n#include <sys/stat.h>\n\nbool verifyFileInstall(const char* srcFile, const char* installDir) {\n    if (access(srcFile, R_OK) != 0) return false;\n    struct stat st;\n    if (stat(installDir, &st) != 0 || !S_ISDIR(st.st_mode)) return false;\n    return access(installDir, W_OK) == 0;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify the source data file exists before the install command.","Check write permissions on the install directory.","On Windows MSVC, ensure 'xcopy' is available and the flags are correct."],"tags":["icu","pkgdata","install","shell-command","file-io","build-tool"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}