This repository was archived by the owner on Jun 16, 2026. It is now read-only.
Description A recent Node JS update includes a breaking change to patch a security vulnerability: https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
When running autorest csharp v2 on Windows, the "spanw EINVAL" error occurs and stops execution.
Tested with both Node v21.7.3 and v18.20.2 (the patch was applied across all major Node versions)
Command:
autorest --input-file=swagger.json --csharp --legacy --add-credentials --namespace=MyApp.Model.Data --output-folder=MyApp.Model\Data
Console output:
AutoRest code generation utility [cli version: 3.7.1; node: v21.7.3]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
info | AutoRest core version selected from configuration: ~2.0.4413.
Loading AutoRest core 'C:\Users\me\.autorest\@microsoft.azureautorest-core@2.0.4429\nodemodules\@microsoft.azure\autorest-core\dist' (2.0.4429)
No configuration found at 'file:///C:/Users/me/repos/PPIThePricingAppIntegration/PricingApp/'.
Loading AutoRest extension '@microsoft.azure/autorest.csharp' (~2.3.79->2.3.102)
Loading AutoRest extension '@microsoft.azure/autorest.modeler' (2.3.55->2.3.55)
Process() cancelled due to exception : spawn EINVAL
Error: spawn EINVAL
Suggested solution from the Security Release announcement:
If the input to spawn/spawnSync is sanitized, users can now pass { shell: true } as an option to prevent the occurrence of EINVALs errors.
Reactions are currently unavailable
A recent Node JS update includes a breaking change to patch a security vulnerability: https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
When running autorest csharp v2 on Windows, the "spanw EINVAL" error occurs and stops execution.
Tested with both Node v21.7.3 and v18.20.2 (the patch was applied across all major Node versions)
Command:
Console output:
Suggested solution from the Security Release announcement: