Skip to content

Commit ca9aa9c

Browse files
committed
fix: update npm command execution to use node binary and change adminforth dependency version to 'next' in package.json template
1 parent 9084bd0 commit ca9aa9c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

adminforth/commands/createApp/templates/package.json.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"dependencies": {
2424
"@dotenvx/dotenvx": "^1.34.0",
25-
"adminforth": "latest",
25+
"adminforth": "next",
2626
"express": "latest-4"
2727
},
2828
"devDependencies": {

adminforth/commands/createApp/utils.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,13 @@ async function installDependencies(ctx, cwd) {
287287
const isWindows = process.platform === 'win32';
288288
const npmCmd = isWindows ? 'npm.cmd' : 'npm';
289289

290+
const nodeBinary = process.execPath;
291+
const npmPath = path.join(path.dirname(nodeBinary), npmCmd);
292+
290293
const customDir = ctx.customDir;
291294
const res = await Promise.all([
292-
await execAsync(`${npmCmd} install`, { cwd, env: { PATH: process.env.PATH } }),
293-
await execAsync(`${npmCmd} install`, { cwd: customDir, env: { PATH: process.env.PATH } }),
295+
await execAsync(`${nodeBinary} ${npmPath} install`, { cwd, env: { PATH: process.env.PATH } }),
296+
await execAsync(`${nodeBinary} ${npmPath} install`, { cwd: customDir, env: { PATH: process.env.PATH } }),
294297
]);
295298
// console.log(chalk.dim(`Dependencies installed in ${cwd} and ${customDir}: \n${res[0].stdout}${res[1].stdout}`));
296299
}

0 commit comments

Comments
 (0)