Azure / Azure/openapi-diff

Runtime Error - something to do with Autorest

Đang mở
#239 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C#
Star
290
Fork
50
Merge trung bình
5 ngày 13 giờ
Pull request đã merge (30 ngày)
5

Mô tả

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'
}

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start by reproducing `oad compare derefd.json derefd2.json` with the reported Node and oad versions, then inspect the AutoRest entry point at `node_modules/autorest/dist/app.js` and its `@autorest/core` version selection. Done means the command can locate the required core package and complete the comparison without the reported runtime error.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
node.js
Lĩnh vực
cli
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.