I am trying to run AutoRest, which I've done several times before, but it's started failing. Here's my command and the failure output. Has anyone else seen any issues similar before?
autorest --input-file=http://localhost:56689/swagger/v1/swagger.json --csharp --output-folder=../Ares --namespace=SPX.ServiceClient.Ares --output-file=AresClient.cs --sync-methods=none --debug --verbose
AutoRest code generation utility [version: 2.0.4283; node: v9.10.0]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
Network Enabled: true
Starting @microsoft.azure/autorest-core from C:\Users\jvoller.autorest\@[email protected]
Failure:
Error: Unable to start AutoRest Core from C:\Users\jvoller.autorest\@[email protected]\node_modules\@microsoft.azure\autorest-core
Error: Unable to start AutoRest Core from C:\Users\jvoller.autorest\@[email protected]\node_modules\@microsoft.azure\autorest-core
at main (C:\Users\jvoller\AppData\Roaming\npm\node_modules\autorest\dist\app.js:232:19)
at
C:\Users\jvoller.autorest\@[email protected]\node_modules\@microsoft.azure\autorest-core\dist\app.js:33
autorest_core_1.Shutdown();
^
ReferenceError: autorest_core_1 is not defined
at process.on (C:\Users\jvoller.autorest\@[email protected]\node_modules\@microsoft.azure\autorest-core\dist\app.js:33:5)
at process.emit (events.js:185:15)
at process.emit (/node_modules/source-map-support/source-map-support.js:439:21)
fs.js:633
return binding.close(fd);
^
Error: EBADF: bad file descriptor, close
at Object.fs.closeSync (fs.js:633:18)
at StaticVolumeFile.shutdown (C:\Users\jvoller\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:352:10)
at StaticFilesystem.shutdown (C:\Users\jvoller\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:406:17)
at process.exit.n [as exit] (C:\Users\jvoller\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:169:11)
at printErrorAndExit (/node_modules/source-map-support/source-map-support.js:423:11)
at process.emit (/node_modules/source-map-support/source-map-support.js:435:16)
at process._fatalException (bootstrap_node.js:431:27)
Looks like my node.js was out of date after a recent update.
npm cache clean -fC:\Users\<profile>\AppData\Roaming\npmnpm install -g autorestLooks like my node.js was out of date after a recent update.
1. Install the latest version of node.js (autorest readme suggests 10.15.x) and included the npm install option (on by default): https://nodejs.org/en/download/ 2. Cleared the global package cache `npm cache clean -f` 3. Deleted everything in `C:\Users\<profile>\AppData\Roaming\npm` 4. Installed again `npm install -g autorest`
Installing newer version of node v10.9.0 worked for me
Updating Node to v10.9.0 worked for me
Sorry to raise this again, but I have not been able to get past this for a couple of days. I have tried different versions, tried to install nodejs via nvm, choco and msi installer. Always the same error trying to use autorest.
AutoRest code generation utility [version: 2.0.4407; node: v13.2.0]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
Failure:
Error: Unable to start AutoRest Core from C:[email protected][email protected][email protected]
Error: Unable to start AutoRest Core from C:[email protected][email protected][email protected]
at main (C:UserskitzmarkAppDataRoamingnpmnode_modulesautorestdistapp.js:233:19)
@kitzmark if you still have no luck resolving the installation issue, you may consider the following open-source alternatives for the time being:
Sorry to say it out loud but there are always little issues (installation, spec, etc) with autorest that make it pretty much unusable.
I get exactly the same error in app.js at line 233
When an application crashes when you are just trying to run --version ... that's a bad sign for me. I appreciate all the hard work but this tool could use some work. Unfortunately, I don't think any of the other code generators support Azure functions though so I really need this.
Most helpful comment
@kitzmark if you still have no luck resolving the installation issue, you may consider the following open-source alternatives for the time being:
Sorry to say it out loud but there are always little issues (installation, spec, etc) with autorest that make it pretty much unusable.