Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

I'm trying to get my Angular app to allow me to read and write to an s3 bucket on my AWS account.

In AngularJS (and most other things) we used the aws-sdk so I'm assuming that the same thing will be able to be done for Angular also.

The problem I'm having though is getting the aws-sdk to import correctly into my project.

I've installed it via npm install aws-sdk

I've tried to import it using

import * as AWS from 'aws-sdk/dist/aws-sdk',

import * as AWS from 'aws-sdk',

import AWS from 'aws-sdk'

import AWS from 'aws-sdk/dist/aws-sdk'

but it keeps telling me that the module doesn't exist.

My project is based on the angular-seed.

I also tried to install the typings file from DefinitleyTyped using typings install aws-sdk but that failed also.

I'm not sure if I need to add anything else in order for it to work or not.

Also, I'm using typescript

1 Answer

0 votes
by (44.4k points)
edited by

But it keeps telling me that the module doesn't exist.

Update TypeScript and aws-sdk to the latest. In your tsconfig make sure you have moduleResolution: node. Now you can simply do:

import * as AWS from 'aws-sdk';

Gaining proficiency in any of these frameworks requires you to be proficient in JavaScript, so to learn any of these frameworks, first enroll in Intellipaat’s Angularjs Online Training.

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...