{"record":{"id":"9541519ea9d21434","repo":"hcengineering/platform","slug":"error-building-local-installation-folder-path-954151","errorCode":null,"errorMessage":"Error building local installation folder (${path__WEBPACK_IMPORTED_MODULE_3__.join(baseFolder, ...pathSegments)}): ${e}","messagePattern":"Error building local installation folder \\((.+?)\\): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"foundations/core/common/scripts/install-run.js","lineNumber":425,"sourceCode":"/**\n * Create missing directories under the specified base directory, and return the resolved directory.\n *\n * Does not support \".\" or \"..\" path segments.\n * Assumes the baseFolder exists.\n */\nfunction _ensureAndJoinPath(baseFolder, ...pathSegments) {\n    let joinedPath = baseFolder;\n    try {\n        for (let pathSegment of pathSegments) {\n            pathSegment = pathSegment.replace(/[\\\\\\/]/g, '+');\n            joinedPath = path__WEBPACK_IMPORTED_MODULE_3__.join(joinedPath, pathSegment);\n            if (!fs__WEBPACK_IMPORTED_MODULE_1__.existsSync(joinedPath)) {\n                fs__WEBPACK_IMPORTED_MODULE_1__.mkdirSync(joinedPath);\n            }\n        }\n    }\n    catch (e) {\n        throw new Error(`Error building local installation folder (${path__WEBPACK_IMPORTED_MODULE_3__.join(baseFolder, ...pathSegments)}): ${e}`);\n    }\n    return joinedPath;\n}\nfunction _getRushTempFolder(rushCommonFolder) {\n    const rushTempFolder = process.env[RUSH_TEMP_FOLDER_ENV_VARIABLE_NAME];\n    if (rushTempFolder !== undefined) {\n        _ensureFolder(rushTempFolder);\n        return rushTempFolder;\n    }\n    else {\n        return _ensureAndJoinPath(rushCommonFolder, 'temp');\n    }\n}\n/**\n * Compare version strings according to semantic versioning.\n * Returns a positive integer if \"a\" is a later version than \"b\",\n * a negative integer if \"b\" is later than \"a\",\n * and 0 otherwise.","sourceCodeStart":407,"sourceCodeEnd":443,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/foundations/core/common/scripts/install-run.js#L407-L443","documentation":"_ensureAndJoinPath builds a nested folder path under a base folder (rush temp/common folders), creating each segment with mkdirSync if missing. Any failure — permission denied, a conflicting file at a segment, invalid path — is rethrown wrapped in this error including the joined path.","triggerScenarios":"Creating the Rush temp folder, package install folder, rush recycler folder, or common folder fails because a parent is read-only, a file exists where a directory is expected, or the disk/path is invalid.","commonSituations":"RUSH_TEMP_FOLDER env var pointing to a read-only or non-existent drive; antivirus/file locks on Windows; a regular file named like the expected folder (e.g. stale 'temp' file) in ~/.rush.","solutions":["Read the wrapped cause `e` and the path in the message; check permissions/ownership of that folder chain","Delete any file that conflicts with the expected folder name in ~/.rush or the temp folder","Set RUSH_TEMP_FOLDER to a writable location for the run","Check free disk space and antivirus interference on Windows"],"exampleFix":"// before\nRUSH_TEMP_FOLDER=/mnt/ro-drive/rush-temp\n// after\nexport RUSH_TEMP_FOLDER=\"$HOME/.rush/temp\"","handlingStrategy":"try-catch","validationCode":"const target = process.env.RUSH_TEMP_FOLDER ?? path.join(os.homedir(), '.rush');\nfs.accessSync(path.dirname(target), fs.constants.W_OK); // throws early if not writable","typeGuard":null,"tryCatchPattern":"try { ensurePaths(); }\ncatch (e) { if (/Error building local installation folder/.test(e.message)) { console.error('Fix permissions or set RUSH_TEMP_FOLDER to a writable path:', e.message); process.exit(1); } throw e; }","preventionTips":["Point RUSH_TEMP_FOLDER at a writable, local (not network) disk","Remove conflicting files that shadow expected folder names under ~/.rush","Confirm disk space and antivirus exclusions on Windows"],"tags":["filesystem","permissions","mkdir"],"backgroundTag":"folder-creation-failed","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}