diff --git a/.changeset/sweet-seahorses-complain.md b/.changeset/sweet-seahorses-complain.md new file mode 100644 index 000000000..d8fc4a035 --- /dev/null +++ b/.changeset/sweet-seahorses-complain.md @@ -0,0 +1,5 @@ +--- +'@gitbook/cli': minor +--- + +Updates the CLI to check for Windows machines in order to install dependencies correctly diff --git a/packages/cli/src/init.ts b/packages/cli/src/init.ts index de9d128fd..2d40dbb2e 100644 --- a/packages/cli/src/init.ts +++ b/packages/cli/src/init.ts @@ -171,7 +171,7 @@ export async function extendPackageJson(dirPath: string, projectName: string): P */ export function installDependencies(dirPath: string): Promise { return new Promise((resolve, reject) => { - const install = spawn('npm', ['install'], { + const install = spawn(/^win/.test(process.platform) ? 'npm.cmd' : 'npm', ['install'], { stdio: 'inherit', cwd: dirPath, });