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

Error: spawn EINVAL #199

Open
pavel-101 opened this issue Apr 30, 2024 · 2 comments
Open

Error: spawn EINVAL #199

pavel-101 opened this issue Apr 30, 2024 · 2 comments

Comments

@pavel-101
Copy link

Hi,

I'm really new to coding so please bare with me. :)
I just installed canvas-sketch and node.js. When I trying to create a new sketch with canvas-sketch i get:
Error: spawn EINVAL
at ChildProcess.spawn (node:internal/child_process:421:11)
at spawn (node:child_process:761:9)
at command (C:\Sketches\node_modules\spawn-npm-install\index.js:45:14)
at Array. (C:\Sketches\node_modules\install-if-needed\index.js:47:9)
at runSeries (C:\Sketches\node_modules\run-series\index.js:23:33)
at run (C:\Sketches\node_modules\install-if-needed\index.js:52:5)
at C:\Sketches\node_modules\read-closest-package\index.js:29:7

I'm running on:
Windows 11 Home
node v20.12.2
npm 10.5.0

Tried:
The suggestion in this post
Install globally, run with npx and --save-dev.
All attempts gives same result,

After searching a bit more i came across this post which talks about a security update to node. I wonder if this is what's causing the issue? If not how, can i get it to work?

@SonoDavid
Copy link

SonoDavid commented May 5, 2024

You can fix it by going to C:\Sketches\node_modules\spawn-npm-install\index.js and changing the lines 36 to 40 to this:

  var spawnArgs = {
    shell: true,
    cwd: opt.cwd,
    env: opt.env || process.env,
    stdio: opt.stdio
  }

adding shell: true to the parameters.

I seems like the folder was downloaded from this repo: https://github.com/mattdesl/spawn-npm-install.

@pavel-101
Copy link
Author

Thank you @SonoDavid for your help, it worked!

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

2 participants