create-socket-app icon indicating copy to clipboard operation
create-socket-app copied to clipboard

Unable to create socket files: Error: spawn EINVAL

Open scsmash3r opened this issue 1 year ago • 0 comments

There is an issue with Node v.22 and up, and this is a breakdown on that one: https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2#command-injection-via-args-parameter-of-child_processspawn-without-shell-option-enabled-on-windows-cve-2024-27980---high

Full debug output:

sc@SC MINGW64 /e/projects/npm-ssc-preprod
$ npx create-socket-app -h
Need to install the following packages:
[email protected]
Ok to proceed? (y) y
usage: npm create socket-app [react | react-ts | svelte | tonic | vanilla | vue]

sc@SC MINGW64 /e/projects/npm-ssc-preprod
$ npm create socket-app svelte
Need to install the following packages:
[email protected]
Ok to proceed? (y) y
Initializing npm package...Ok.
Installing developer dependencies...Ok.
Installing dependencies...Ok.
Adding package scripts...Ok.
Creating socket files...
Unable to create socket files: Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:420:11)
    at spawn (node:child_process:759:9)
    at main (file:///C:/Users/sc/AppData/Local/npm-cache/_npx/c1dc6c5b122b41fc/node_modules/create-socket-app/index.js:233:25)
Ok.
Updating project configuration...
Unable to read socket.ini: Error: ENOENT: no such file or directory, open 'E:\projects\npm-ssc-preprod\socket.ini'
    at async open (node:internal/fs/promises:638:25)
    at async Object.readFile (node:internal/fs/promises:1238:14)
    at async main (file:///C:/Users/sc/AppData/Local/npm-cache/_npx/c1dc6c5b122b41fc/node_modules/create-socket-app/index.js:286:14)
npm ERR! code 1
npm ERR! path E:\projects\npm-ssc-preprod
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c create-socket-app svelte

While doing the same npm create socket-app svelte command, but with node v.20.10.0, there is no issues spotted, and process goes as intended:

sc@SC MINGW64 /e/projects/npm-ssc-preprod
$ npm create socket-app svelte
Initializing npm package...Ok.
Installing developer dependencies...Ok.
Installing dependencies...Ok.
Adding package scripts...Ok.
Creating socket files...
> [email protected] init-project
> ssc init --config

• project name: npm-ssc-preprod 1ms
• socket.ini created in E:\projects\npm-ssc-preprod 6ms
Ok.
Updating project configuration...Ok.
Copying project boilerplate...Ok.

Type 'npm start' to launch the app

scsmash3r avatar Nov 01 '24 01:11 scsmash3r