Merge pull request #473 from presenton/fix/windows-npm-spawn-issue
fix: resolve npm spawn issue on Windows by using npm.cmd and enabling…
This commit is contained in:
commit
929f5b4883
2 changed files with 3 additions and 1 deletions
Binary file not shown.
|
|
@ -71,13 +71,15 @@ export async function startNextJsServer(
|
|||
let nextjsProcess;
|
||||
|
||||
if (isDev) {
|
||||
// Windows: npm is npm.cmd; spawn() needs a shell or ENOENT.
|
||||
nextjsProcess = spawn(
|
||||
"npm",
|
||||
process.platform === "win32" ? "npm.cmd" : "npm",
|
||||
["run", "dev", "--", "-p", port.toString()],
|
||||
{
|
||||
cwd: directory,
|
||||
stdio: ["ignore", "pipe", "pipe"],
|
||||
env: { ...process.env, ...env },
|
||||
shell: process.platform === "win32",
|
||||
}
|
||||
);
|
||||
const nextjsLogPath = path.join(logsDir, "nextjs-server.log");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue