hcengineering/platform · error · Error
Error building local installation folder (${path__WEBPACK_IM
Error message
Error building local installation folder (${path__WEBPACK_IMPORTED_MODULE_3__.join(baseFolder, ...pathSegments)}): ${e} What it means
_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.
Source
Thrown at foundations/core/common/scripts/install-run.js:425
/**
* Create missing directories under the specified base directory, and return the resolved directory.
*
* Does not support "." or ".." path segments.
* Assumes the baseFolder exists.
*/
function _ensureAndJoinPath(baseFolder, ...pathSegments) {
let joinedPath = baseFolder;
try {
for (let pathSegment of pathSegments) {
pathSegment = pathSegment.replace(/[\\\/]/g, '+');
joinedPath = path__WEBPACK_IMPORTED_MODULE_3__.join(joinedPath, pathSegment);
if (!fs__WEBPACK_IMPORTED_MODULE_1__.existsSync(joinedPath)) {
fs__WEBPACK_IMPORTED_MODULE_1__.mkdirSync(joinedPath);
}
}
}
catch (e) {
throw new Error(`Error building local installation folder (${path__WEBPACK_IMPORTED_MODULE_3__.join(baseFolder, ...pathSegments)}): ${e}`);
}
return joinedPath;
}
function _getRushTempFolder(rushCommonFolder) {
const rushTempFolder = process.env[RUSH_TEMP_FOLDER_ENV_VARIABLE_NAME];
if (rushTempFolder !== undefined) {
_ensureFolder(rushTempFolder);
return rushTempFolder;
}
else {
return _ensureAndJoinPath(rushCommonFolder, 'temp');
}
}
/**
* Compare version strings according to semantic versioning.
* Returns a positive integer if "a" is a later version than "b",
* a negative integer if "b" is later than "a",
* and 0 otherwise.View on GitHub (pinned to 63e28dc964)
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
Example fix
// before RUSH_TEMP_FOLDER=/mnt/ro-drive/rush-temp // after export RUSH_TEMP_FOLDER="$HOME/.rush/temp"
Defensive patterns
Strategy: try-catch
Validate before calling
const target = process.env.RUSH_TEMP_FOLDER ?? path.join(os.homedir(), '.rush'); fs.accessSync(path.dirname(target), fs.constants.W_OK); // throws early if not writable
Try / catch
try { ensurePaths(); }
catch (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; } Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Error building local installation folder (${path__WEBPACK_IM
- Unable to create package.json: ${e}
- Unable to create installed.flag file in ${packageInstallFold
- Unable to create package.json: ${e}
- Error syncing .npmrc file: ${e}
AI-assisted analysis of hcengineering/platform@63e28dc964 (2026-08-29).
Data as JSON: /api/errors/9541519ea9d21434.
Report an issue: GitHub.