Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EINVAL errors when using Node.JS 18.20.4 on Windows 11 #606

Open
jjhritz89 opened this issue Oct 24, 2024 · 1 comment
Open

EINVAL errors when using Node.JS 18.20.4 on Windows 11 #606

jjhritz89 opened this issue Oct 24, 2024 · 1 comment

Comments

@jjhritz89
Copy link

Due to a security change in Node.js for Windows (CVE-2024-27980) linked here The "gitbook new" action would throw a spawn EINVAL error when attempting to install dependencies.

The fix I had to do, was add shell:true to the installdependencies function as shown here:

function installDependencies(dirPath) {
  return new Promise((resolve6, reject) => {
    const install = (0, import_child_process2.spawn)(/^win/.test(process.platform) ? "npm.cmd" : "npm", ["install"], {
      studio: "inherit",
      shell: true,
      cwd: dirPath
    });
    install.on("close", (code) => {
      if (code !== 0) {
        throw new Error(`npm install exited with code ${code}`);
      }
      resolve6();
    });
  });
}

However, I'm having a similar issue when attempting the "gitbook dev" action, I get a ENOENT issue which seems to be related to the spawn command also.

@jjhritz89
Copy link
Author

It appears to be under the 'createDevTunnel' function.

This is all under the cli.js file that is created when a new integration is made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant