You need:
npm install aws-sdk -S
Then make sure you have this type installed (if you are not sure, then just run the code below):
npm install --save-dev @types/node
Now in your src folder you will find tsconfig.app.ts
(make sure you are not confused with tsconfig.ts
in the root directory).
Type string
empty and looks like this: "types": []
. You need to edit it. Tsconfig.app.ts should look like this after adding "types": ["node"]
:
{ "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/app", "module": "es2015", "baseUrl": "", "types": ["node"] }, "exclude": [ "test.ts", "**/*.spec.ts" ] }
Now you can just
import * as AWS from 'aws-sdk';
source share