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 ENOENT error spawn on Windows #284

Merged
merged 1 commit into from
Feb 15, 2025
Merged

Conversation

adrieljss
Copy link
Contributor

@adrieljss adrieljss commented Feb 14, 2025

This Pull Request was made to handle the following ENOENT error:

image

  • After a bit of investigating, spawn processes on Windows works differently than Mac/Linux systems, sometimes you have to suffix ".cmd" on the commands, etc.

To fix this, I use cross-spawn, a popular npm package to handle cross platform spawns and it fixed this issue.

  • The only change that was made was to install cross-spawn and changed the spawn import from child_process to cross-spawn in the build.js file.

  • Everything works fine after that and the application ran, and the watch feature in Windows works great.


Important

Fixes ENOENT error on Windows by using cross-spawn for process spawning in build.js.

  • Behavior:
    • Fixes ENOENT error on Windows by replacing child_process.spawn with cross-spawn in build.js.
    • Ensures cross-platform compatibility for spawning processes.
  • Dependencies:
    • Adds cross-spawn to package.json dependencies.
  • Imports:
    • Changes spawn import from child_process to cross-spawn in build.js.

This description was created by Ellipsis for 1839aca. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 1839aca in 43 seconds

More details
  • Looked at 26 lines of code in 2 files
  • Skipped 1 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. package.json:112
  • Draft comment:
    Ensure dependency lock for cross-spawn version if strict version compatibility is needed.
  • Reason this comment was not posted:
    Confidence changes required: 10% <= threshold 50%
    None
2. src/vs/workbench/contrib/void/browser/react/build.js:7
  • Draft comment:
    Using cross-spawn provides cross-platform support, but ensure argument quoting works as expected on Windows.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50%
    None
3. package.json:110
  • Draft comment:
    Cross-spawn was added to fix Windows spawn issues. If build.js is only used during development, consider moving this dependency to devDependencies.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
4. src/vs/workbench/contrib/void/browser/react/build.js:7
  • Draft comment:
    Good use of cross-spawn for improved Windows compatibility. For consistency, consider adding a semicolon at the end of the import statement.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None

Workflow ID: wflow_iCP3HWA3gMbhkPGl


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@andrewpareles
Copy link
Contributor

Nice fix!

@andrewpareles andrewpareles merged commit ea6e025 into voideditor:main Feb 15, 2025
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