aws-sdk module installation errors in angular ionic project.

0

Enter image description here

Can anyone help me resolve the errors due to the installation of aws-sdk module. npm i aws-sdk

import * as AWS from 'aws-sdk';

getAWSAccess(){
    const cognitoUser = this.userpool.getCurrentUser();
    AWS.config.region = 'us-east-1'
    return new Promise((resolve, reject) => {
      cognitoUser?.getSession((error:Error, result:any)=> {
        if (result) {
          // Add the User's Id Token to the Cognito credentials login map.
          AWS.config.credentials = new AWS.CognitoIdentityCredentials({
            IdentityPoolId: 'us-east-1:39c683dc-c454-426c-a3c4-b8c425447c18',
            Logins: {
              'cognito-idp.us-east-1.amazonaws.com/us-east-1_9lAFiKAxg': result.getIdToken().getJwtToken()
            }
          });
        }
      });
    }
    )
	

1回答
0

Hi,

I would say that TypeScript is complaining because some node type definitions are missing. Could you execute npm install --save-dev @types/node and try again?

profile picture
エキスパート
回答済み 5ヶ月前
  • I tried npm install --save-dev @types/node this command but still the error persists. Can you suggest me any other solutions

  • I'm sorry to hear that. What error do you have after executing the command? Take a look at the solution proposed in this article, it may help you.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ