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

Runtime Error - something to do with Autorest #239

Open
rao-anant opened this issue Aug 19, 2022 · 1 comment
Open

Runtime Error - something to do with Autorest #239

rao-anant opened this issue Aug 19, 2022 · 1 comment

Comments

@rao-anant
Copy link

rao-anant commented Aug 19, 2022

I installed it like so:
npm install -g @azure/oad

My env:
OS: MacOS Monterey 12.4

oad ver: 0.9.7

$ npm --version
6.14.16

$ node --version
v12.22.12

$ nvm --version
0.39.1

Then, tried to run the command:
oad compare derefd.json derefd2.json

Got:
Error: Command failed: node /Users/ananrao/.nvm/versions/node/v12.22.12/lib/node_modules/@azure/oad/node_modules/autorest/dist/app.js --v2 --input-file=derefd.json --output-artifact=swagger-document.json --output-artifact=swagger-document.map --output-file=old --output-folder=/var/folders/_v/yt6hqgc91zs8r1zzwr8g5tb80000gq/T
Error: Unable to find a valid AutoRest core package '@autorest/core' @ '~2.0.4413'.
Error: Unable to find a valid AutoRest core package '@autorest/core' @ '~2.0.4413'.
at selectVersion (/Users/ananrao/.nvm/versions/node/v12.22.12/lib/node_modules/@azure/oad/node_modules/autorest/dist/src_autorest-as-a-service_ts.js:393:23)

at ChildProcess.exithandler (child_process.js:308:12)
at ChildProcess.emit (events.js:314:20)
at maybeClose (internal/child_process.js:1022:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {

killed: false,
code: 1,
signal: null,
cmd: 'node /Users/ananrao/.nvm/versions/node/v12.22.12/lib/node_modules/@azure/oad/node_modules/autorest/dist/app.js --v2 --input-file=derefd.json --output-artifact=swagger-document.json --output-artifact=swagger-document.map --output-file=old --output-folder=/var/folders/_v/yt6hqgc91zs8r1zzwr8g5tb80000gq/T',
stdout: 'AutoRest code generation utility [cli version: 3.6.2; node: v12.22.12]\n' +
'(C) 2018 Microsoft Corporation.\n' +
'https://aka.ms/autorest\n' +
'info | AutoRest core version selected from configuration: ~2.0.4413.\n' +
'Failure:\n',
stderr: "Error: Unable to find a valid AutoRest core package '@autorest/core' @ '~2.0.4413'.\n" +
"Error: Unable to find a valid AutoRest core package '@autorest/core' @ '~2.0.4413'.\n" +
' at selectVersion (/Users/ananrao/.nvm/versions/node/v12.22.12/lib/node_modules/@azure/oad/node_modules/autorest/dist/src_autorest-as-a-service_ts.js:393:23)\n'
}

@rao-anant rao-anant changed the title Install issue Runtime Error Aug 19, 2022
@rao-anant rao-anant changed the title Runtime Error Runtime Error - something to do with Autorest Aug 19, 2022
@vernou
Copy link

vernou commented Nov 16, 2022

I have the same problem.

OS: Windows 10 Professionnel 21H2

>oad --version
0.10.2
>npm --version
8.15.0
>node --version
v16.17.0

The commande oad compare run ~10 minutes and throw the error below. In validate_log_***.log :

{"level":"silly","message":"Initializing OpenApiDiff class"}
{"level":"debug","message":"Initialized OpenApiDiff class with options = { consoleLogLevel: 'warn', logFilepath: undefined, json: true }"}
{"level":"silly","message":"compare is being called"}
{"level":"silly","message":"processViaAutoRest is being called"}
{"level":"debug","message":"swaggerPath = \"swagger-v2.json\""}
{"level":"debug","message":"outputFileName = \"old\""}
{"level":"silly","message":"autoRestPath is being called"}
{"level":"silly","message":"Found autoRest:C:\\Users\\vernou\\AppData\\Roaming\\npm\\node_modules\\@azure\\oad\\node_modules\\autorest\\dist\\app.js "}
{"level":"debug","message":"Executing: \"node C:\\Users\\vernou\\AppData\\Roaming\\npm\\node_modules\\@azure\\oad\\node_modules\\autorest\\dist\\app.js --v2 --input-file=swagger-v2.json --output-artifact=swagger-document.json --output-artifact=swagger-document.map --output-file=old --output-folder=C:\\Users\\vernou\\AppData\\Local\\Temp\""}

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

No branches or pull requests

2 participants