@ha-bits/cortex 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server/main.cjs +8 -0
- package/server/package.json +1 -1
package/package.json
CHANGED
package/server/main.cjs
CHANGED
|
@@ -308,9 +308,17 @@ async function installNpmModule(moduleDefinition, targetDir) {
|
|
|
308
308
|
installedPackagePath = path2.join(tempDir, "node_modules", packageName);
|
|
309
309
|
}
|
|
310
310
|
if (fs.existsSync(installedPackagePath)) {
|
|
311
|
+
const parentDir = path2.dirname(modulePath);
|
|
312
|
+
if (!fs.existsSync(parentDir)) {
|
|
313
|
+
fs.mkdirSync(parentDir, { recursive: true });
|
|
314
|
+
}
|
|
311
315
|
fs.renameSync(installedPackagePath, modulePath);
|
|
312
316
|
} else {
|
|
313
317
|
const nodeModulesPath = path2.join(tempDir, "node_modules");
|
|
318
|
+
const parentDir = path2.dirname(modulePath);
|
|
319
|
+
if (!fs.existsSync(parentDir)) {
|
|
320
|
+
fs.mkdirSync(parentDir, { recursive: true });
|
|
321
|
+
}
|
|
314
322
|
if (packageName.startsWith("@")) {
|
|
315
323
|
const [scope] = packageName.split("/");
|
|
316
324
|
const scopedDir = path2.join(nodeModulesPath, scope);
|