Skip to content

[Bug] Autorest cli doesn't install extensions correctly on first try. #112

@kasobol-msft

Description

@kasobol-msft

Please see versions on the screenshots.

Reproduction scenario:

  1. Make sure extension is removed from <User_DIR>/.autorest . In my example I'm using @microsoft.azure/autorest.java@3.0.1 @microsoft.azure/autorest.modeler@2.3.51 extensions.
  2. Execute autorest --use=@microsoft.azure/autorest.java@3.0.1 --use=@microsoft.azure/autorest.modeler@2.3.51 --version=2.0.4280
    image
  3. Execute autorest --use=@microsoft.azure/autorest.java@3.0.1 --use=@microsoft.azure/autorest.modeler@2.3.51 --version=2.0.4280 again
    image
  4. Execute autorest --use=@microsoft.azure/autorest.java@3.0.1 --use=@microsoft.azure/autorest.modeler@2.3.51 --version=2.0.4280 again
    image

Bottom line is that Autorest fails when extension is pulled first time with such error:

   Loading AutoRest core      'C:\Users\kasobol.REDMOND\.autorest\@microsoft.azure_autorest-core@2.0.4280\node_modules\@microsoft.azure\autorest-core\dist' (2.0.4280)
   Loading AutoRest extension '@microsoft.azure/autorest.java' (3.0.1->3.0.1)
   Installing AutoRest extension '@microsoft.azure/autorest.modeler' (2.3.51)
TypeError: Cannot read property 'filename' of undefined
    at /node_modules/npm/node_modules/npm-lifecycle/index.js:66:39
    at /node_modules/npm/node_modules/npm-lifecycle/index.js:186:12
    at /node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqWrap.oncomplete (fs.js:154:5)

Second attempt is successful. In my example I pulled two fresh extensions hence I worked on 3rd attempt...

Please fix that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions