I'm trying to get my Angular2
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 Angular2
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 off the angular2-seed.
I also tried to install the typings file from DefinitleyTyped using typings install aws-sdk
but that failed also.
I'm not sure about if I need to add anything else in order for it to work or not.
Also, I'm using typescript
Thanks for your time and assistance.
aws-sdk is not compatible with Angular 12 #3824.
The AWS SDK for JavaScript simplifies use of AWS Services by providing a set of libraries that are consistent and familiar for JavaScript developers. It provides support for API lifecycle consideration such as credential management, retries, data marshaling, serialization, and deserialization.
But it keeps telling me that the module doesn't exist.
Update TypeScript and aws-sdk to latest. In your tsconfig make sure you have moduleResolution: node
. Now you can simply do:
import * as AWS from 'aws-sdk';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With