NSwag icon indicating copy to clipboard operation
NSwag copied to clipboard

command: dotnet node_modules/nswag/bin/binaries/NetCore21/dotnet-nswag.dll" run nswag.file.json

Open ManiPandiri opened this issue 2 years ago • 2 comments

I am getting this below error while running the npm run generate command. Can any one help me how to resolve this issue ?

I have tried setting the runtime to NetCore21, but that does not help much.

Failed to initialize CoreCLR, HRESULT: 0x80004005 node:child_process:902 throw err; ^ Error: Command failed: dotnet node_modules/nswag/bin/binaries/NetCore21/dotnet-nswag.dll" run nswag.filejson at checkExecSyncError (node:child_process:828:11) at Object.execSync (node:child_process:899:15) at node_modules/nswag/bin/nswag.js:69:11 at ChildProcess.exithandler (node:child_process:390:7) at ChildProcess.emit (node:events:527:28) at maybeClose (node:internal/child_process:1090:16) at Socket. (node:internal/child_process:449:11) at Socket.emit (node:events:527:28) at Pipe. (node:net:688:12) { status: 137, signal: null, output: [ null, null, null ], pid: 4375, stdout: null, stderr: null }

ManiPandiri avatar Apr 11 '22 16:04 ManiPandiri

@ManiPandiri - same. Did you get this to work? This happened some time last year but was due to an automatic switch to .NET 6. Previously the solution was to ensure that .NET 3.1 was being used, but now that solution doesn't work either. I'm curious as to why nswag is going to NetCore21... if this means 2.1, 2.1 has long been end of life, and shouldn't be used at all....

princefishthrower avatar Jul 20 '22 16:07 princefishthrower

@ManiPandiri - turns out my nswag was too old, I installed the latest (13.16.1 at the time of this post) with:

npm install nswag@latest

also note I had "runtime": "Default" in my nswag .json config file

Now it's working again!

princefishthrower avatar Jul 20 '22 16:07 princefishthrower