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

Fix EINVAL crash #82

Merged
merged 4 commits into from
Dec 23, 2024
Merged

Conversation

addison-adler
Copy link
Contributor

@addison-adler addison-adler commented Dec 22, 2024

Related Issues:

There's a weird crash with the latest version of NodeJS when running ropm.

Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:421:11)
    at Object.spawn (node:child_process:760:9)
    at C:\Users\bronley\AppData\Roaming\npm\node_modules\ropm\dist\util.js:24:40
    at new Promise (<anonymous>)
    at Util.spawnAsync (C:\Users\bronley\AppData\Roaming\npm\node_modules\ropm\dist\util.js:23:16)
    at Util.spawnNpmAsync (C:\Users\bronley\AppData\Roaming\npm\node_modules\ropm\dist\util.js:37:21)
    at InstallCommand.npmInstall (C:\Users\bronley\AppData\Roaming\npm\node_modules\ropm\dist\commands\InstallCommand.js:70:27)
    at async InstallCommand.run (C:\Users\bronley\AppData\Roaming\npm\node_modules\ropm\dist\commands\InstallCommand.js:39:13) {
  errno: -4071,
  code: 'EINVAL',
  syscall: 'spawn'
} ```

Adding `shell: true` fixes the crash

@TwitchBronBron
Copy link
Member

TwitchBronBron commented Dec 22, 2024

I THINK I remember seeing this option also pop open an actual shell popup. But there's another option for show: false. Could you check into that and report back?

I'd prefer to hide the popup shell if possible..

@addison-adler
Copy link
Contributor Author

addison-adler commented Dec 22, 2024

I THINK I remember seeing this option also pop open an actual shell popup. But there's another option for show: false. Could you check into that and report back?

I'd prefer to hide the popup shell if possible..

There is another option we can add for this: windowsHide
Hide the subprocess console window that would normally be created on Windows systems.

I didn't actually see any popups on my PC (windows), but it doesn't hurt to add

@addison-adler
Copy link
Contributor Author

addison-adler commented Dec 22, 2024

... and I have just learned that there are unit tests related to this.. I'll update those 😄

edit: added windowsHide: true and updated the unit test

Copy link
Member

@TwitchBronBron TwitchBronBron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks!

@TwitchBronBron TwitchBronBron merged commit 8863439 into rokucommunity:master Dec 23, 2024
5 checks passed
@addison-adler addison-adler deleted the patch-1 branch December 24, 2024 07:34
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

Successfully merging this pull request may close these issues.

2 participants