Azure / Azure/openapi-diff

Error: Unable to find a valid AutoRest core package

Open
#262 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
290
Forks
50
Avg merge
5d 13h
Merged PRs (30d)
5

Description

1. Installed the module locally on macosx
2. node v10.24.1

```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/anktiwari/.nvm/versions/node/v10.24.1/lib/node_modules/@azure/oad/node_modules/autorest/dist/src_autorest-as-a-service_ts.js:393:23)

at ChildProcess.exithandler (child_process.js:294:12)
at ChildProcess.emit (events.js:198:13)
at maybeClose (internal/child_process.js:982:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
killed: false,
code: 1,
signal: null,
cmd:
'node /Users/anktiwari/.nvm/versions/node/v10.24.1/lib/node_modules/@azure/oad/node_modules/autorest/dist/app.js --v2 --input-file=swagger-c.json --output-artifact=swagger-document.json --output-artifact=swagger-document.map --output-file=old --output-folder=/var/folders/mw/kyxpq1hs3xjg1bybxm_cw1lm0000gq/T',
stdout:
'AutoRest code generation utility [cli version: 3.6.2; node: v10.24.1]\n(C) 2018 Microsoft Corporation.\nhttps://aka.ms/autorest\ninfo | AutoRest core version selected from configuration: ~2.0.4413.\nFailure:\n',
stderr:
'Error: Unable to find a valid AutoRest core package \'@autorest/core\' @ \'~2.0.4413\'.\nError: Unable to find a valid AutoRest core package \'@autorest/core\' @ \'~2.0.4413\'.\n at selectVersion (/Users/anktiwari/.nvm/versions/node/v10.24.1/lib/node_modules/@azure/oad/node_modules/autorest/dist/src_autorest-as-a-service_ts.js:393:23)\n' }
```

I even tried installing autorest/core node module globally which was successful but still the same error

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported command with Node v10.24.1 and the selected AutoRest core version ~2.0.4413. Inspect autorest/dist/src_autorest-as-a-service_ts.js at selectVersion and how the @autorest/core package is resolved. Done means the command can locate a valid core package and proceed without this error.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.