Azure-sdk-for-js: @azure/ms-rest-nodeauth latest npm dist tag points to 2.0.5

Created on 2 Dec 2019  路  8Comments  路  Source: Azure/azure-sdk-for-js

STR:

npm i --save @azure/arm-storage @azure/ms-rest-nodeauth

+ @azure/[email protected]
+ @azure/[email protected]
updated 2 packages and audited 246 packages in 4.574s
found 0 vulnerabilities

index.ts:

import { StorageManagementClient } from "@azure/arm-storage";
import { AzureCliCredentials } from "@azure/ms-rest-nodeauth";

(async () => {
    const creds = await AzureCliCredentials.create();
    new StorageManagementClient(creds, creds.tokenInfo.subscription)
})()

npx tsc index.ts:

index.ts:6:30 - error TS2345: Argument of type 'AzureCliCredentials' is not assignable to parameter of type 'ServiceClientCredentials'.
  Types of property 'signRequest' are incompatible.
    Type '(webResource: import("/tmp/storage-node/node_modules/@azure/ms-rest-nodeauth/node_modules/@azure/ms-rest-js/es/lib/webResource").WebResource) => Promise<import("/tmp/storage-node/node_modules/@azure/ms-rest-nodeauth/node_modules/@azure/ms-rest-js/es/lib/webResource").WebResource>' is not assignable to type '(webResource: import("/tmp/storage-node/node_modules/@azure/ms-rest-js/es/lib/webResource").WebResource) => Promise<import("/tmp/storage-node/node_modules/@azure/ms-rest-js/es/lib/webResource").WebResource>'.
      Types of parameters 'webResource' and 'webResource' are incompatible.
        Type 'import("/tmp/storage-node/node_modules/@azure/ms-rest-js/es/lib/webResource").WebResource' is not assignable to type 'import("/tmp/storage-node/node_modules/@azure/ms-rest-nodeauth/node_modules/@azure/ms-rest-js/es/lib/webResource").WebResource'.
          Types of property 'headers' are incompatible.
            Type 'import("/tmp/storage-node/node_modules/@azure/ms-rest-js/es/lib/httpHeaders").HttpHeaders' is not assignable to type 'import("/tmp/storage-node/node_modules/@azure/ms-rest-nodeauth/node_modules/@azure/ms-rest-js/es/lib/httpHeaders").HttpHeaders'.
              Types have separate declarations of a private property '_headersMap'.

6  new StorageManagementClient(creds, creds.tokenInfo.subscription)
                               ~~~~~


Found 1 error.

Mgmt Storage customer-reported

All 8 comments

Thanks for reporting @coderbyheart

The @azure/arm-storage version 10 and above is compatible with only v3 and above of @azure/ms-rest-nodeauth.

Any reason why you wouldnt want to update the version of @azure/ms-rest-nodeauth you are using?

Those two versions were installed through npm without passing a version argument.

npm i --save @azure/arm-storage @azure/ms-rest-nodeauth

Note that @azure/ms-rest-nodeauth version 3.0.3 is not the latest on npm: https://www.npmjs.com/package/@azure/ms-rest-nodeauth

npm show @azure/ms-rest-nodeauth

@azure/[email protected] | MIT | deps: 3 | versions: 23
Azure Authentication library in node.js with type definitions.
https://github.com/Azure/ms-rest-nodeauth

keywords: node, azure, autorest, authentication, environment, adal

dist
.tarball: https://registry.npmjs.org/@azure/ms-rest-nodeauth/-/ms-rest-nodeauth-2.0.5.tgz
.shasum: e19877c707d4912853b5b58ec6e9c214eb15bb30
.integrity: sha512-pS2NLW3TY4tPvHcF7QIW2xYoXrpEpodbz1oFCnWnTRw2w38reCq1OyktfLDBkpEUVTN+GrAA5ZgnX6PcZxvJeg==
.unpackedSize: 360.5 kB

dependencies:
@azure/ms-rest-azure-env: ^2.0.0 @azure/ms-rest-js: ^1.8.13       adal-node: ^0.1.28               

maintainers:
- amarzavery <[email protected]>
- azure-sdk <[email protected]>
- billytrend <[email protected]>
- sergeyshandar <[email protected]>
- veronicagg <[email protected]>
- vladbarosan <[email protected]>

dist-tags:
latest: 2.0.5  

published 3 months ago by azure-sdk <[email protected]>

@coderbyheart @ramya-rao-a ms-rest-nodeauth package has recently changed the latest version from 3.X back to 2.X. you can refer to this PR https://github.com/Azure/ms-rest-nodeauth/pull/78.

Ok, so I understand this is intentional and one has to know somehow which version is compatible.

Thanks for working with Microsoft on GitHub! Tell us how you feel about your experience using the reactions on this comment.

@qiaozha https://github.com/Azure/ms-rest-nodeauth/pull/78 tells me that the bug fixes in v3 were cherry-picked to v2, but it doesn't mention anything about why v3 is not having the latest tag.

@daviwil Are you aware of any reason why v3 of ms-rest-nodeauth wouldn't have the latest tag?

I think this happened because of how the release automation for this repository works. Because 3.0.3 was published before 2.0.5, the latter got marked as latest by the release script. We can have someone fix that.

@coderbyheart We have fixed the tag issue. The latest tag now points to version 3.0.3

Thanks a lot for reporting this!

Was this page helpful?
0 / 5 - 0 ratings