Closed rwahdan1978 closed 7 months ago
Hi @rwahdan1978 - thanks for reaching out and apologies for not getting back sooner.
For the error you're seeing, you'd need to add "types": ["node"]
to the tsconfig.app.json
file that the angular-cli creates in the src
directory. By default, types
is an empty array.
Please refer to this comment for reference: https://github.com/aws/aws-sdk-js/issues/1271#issuecomment-291658668
If the issue persists, let us know and we'd be happy to assist you further.
Best, John
This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.
Describe the bug
I installed the package using
npm i aws-sdk
and then added the node in types and installednpm i --save-dev @types/node
and in my ts fileimport * as aws from 'aws-sdk';
but still getting many errors.Expected Behavior
I expected to run the App with no errors
Current Behavior
Error: node_modules/aws-sdk/clients/cognitoidentityserviceprovider.d.ts:2836:31 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig.2836 export type ImageFileType = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/datasync.d.ts:1995:36 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.1995 export type KerberosKeytabFile = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/datasync.d.ts:2441:42 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.2441 export type ObjectStorageCertificate = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/dms.d.ts:1070:35 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.1070 export type CertificateWallet = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/dynamodbstreams.d.ts:92:38 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.92 export type BinaryAttributeValue = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/ebs.d.ts:75:27 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.75 export type BlockData = Buffer|Uint8Array|Blob|string|Readable;
Error: node_modules/aws-sdk/clients/ecrpublic.d.ts:698:31 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.698 export type LayerPartBlob = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/ec2.d.ts:7187:23 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.7187 export type _Blob = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/frauddetector.d.ts:3576:22 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.3576 export type blob = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/glacier.d.ts:8:24 - error TS2307: Cannot find module 'stream' or its corresponding type declarations.
8 import {Readable} from 'stream';
Error: node_modules/aws-sdk/clients/glue.d.ts:2492:23 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.2492 export type _Blob = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/iam.d.ts:1463:32 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.1463 export type BootstrapDatum = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/iot.d.ts:9331:30 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.9331 export type MqttPassword = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/iotanalytics.d.ts:1539:32 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.1539 export type MessagePayload = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/iotdata.d.ts:188:25 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.188 export type Payload = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/ioteventsdata.d.ts:667:25 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.667 export type Payload = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/iotsitewise.d.ts:3787:31 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.3787 export type ImageFileData = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/kafka.d.ts:4114:24 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.4114 export type __blob = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/kinesis.d.ts:367:22 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.367 export type Data = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/kinesisvideoarchivedmedia.d.ts:7:24 - error TS2307: Cannot find module 'stream' or its corresponding type declarations.
7 import {Readable} from 'stream';
Error: node_modules/aws-sdk/clients/kinesisvideomedia.d.ts:7:24 - error TS2307: Cannot find module 'stream' or its corresponding type declarations.
7 import {Readable} from 'stream';
Error: node_modules/aws-sdk/clients/kms.d.ts:443:41 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.443 export type AttestationDocumentType = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/kms.d.ts:1588:31 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.1588 export type PlaintextType = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/lakeformation.d.ts:7:24 - error TS2307: Cannot find module 'stream' or its corresponding type declarations.
7 import {Readable} from 'stream';
Error: node_modules/aws-sdk/clients/lambda.d.ts:9:24 - error TS2307: Cannot find module 'stream' or its corresponding type declarations.
9 import {Readable} from 'stream';
Error: node_modules/aws-sdk/clients/lambda.d.ts:778:28 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.778 export type BlobStream = Buffer|Uint8Array|Blob|string|Readable;
Error: node_modules/aws-sdk/clients/lexmodelbuildingservice.d.ts:355:23 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.355 export type _Blob = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/lexruntime.d.ts:89:28 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.89 export type BlobStream = Buffer|Uint8Array|Blob|string|Readable;
Error: node_modules/aws-sdk/clients/lexruntimev2.d.ts:88:28 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.88 export type BlobStream = Buffer|Uint8Array|Blob|string|Readable;
Error: node_modules/aws-sdk/clients/lookoutvision.d.ts:7:24 - error TS2307: Cannot find module 'stream' or its corresponding type declarations.
7 import {Readable} from 'stream';
Error: node_modules/aws-sdk/clients/lookoutvision.d.ts:288:32 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.288 export type DatasetChanges = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/medialive.d.ts:8:24 - error TS2307: Cannot find module 'stream' or its corresponding type declarations.
8 import {Readable} from 'stream';
Error: node_modules/aws-sdk/clients/mediastoredata.d.ts:7:24 - error TS2307: Cannot find module 'stream' or its corresponding type declarations.
7 import {Readable} from 'stream';
Error: node_modules/aws-sdk/clients/medicalimaging.d.ts:7:24 - error TS2307: Cannot find module 'stream' or its corresponding type declarations.
7 import {Readable} from 'stream';
Error: node_modules/aws-sdk/clients/medicalimaging.d.ts:715:38 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.715 export type ImageSetMetadataBlob = Buffer|Uint8Array|Blob|string|Readable;
Error: node_modules/aws-sdk/clients/mobile.d.ts:106:26 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.106 export type Contents = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/neptunedata.d.ts:1577:30 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.1577 export type ReportAsText = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/omics.d.ts:1069:23 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.1069 export type _Blob = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/omics.d.ts:3960:38 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.3960 export type ReadSetStreamingBlob = Buffer|Uint8Array|Blob|string|Readable;
Error: node_modules/aws-sdk/clients/panorama.d.ts:355:30 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.355 export type Certificates = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/pinpointemail.d.ts:1505:32 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.1505 export type RawMessageData = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/polly.d.ts:8:24 - error TS2307: Cannot find module 'stream' or its corresponding type declarations.
8 import {Readable} from 'stream';
Error: node_modules/aws-sdk/clients/qbusiness.d.ts:735:23 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.735 export type _Blob = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/qldbsession.d.ts:32:30 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.32 export type CommitDigest = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/quicksight.d.ts:1960:43 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.1960 export type AssetBundleImportBodyBlob = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/redshiftdata.d.ts:164:23 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.164 export type _Blob = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/rekognition.d.ts:2834:27 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.2834 export type ImageBlob = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/rolesanywhere.d.ts:241:23 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.241 export type _Blob = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/rolesanywhere.d.ts:837:45 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.837 export type UpdateCrlRequestCrlDataBlob = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/sagemakergeospatial.d.ts:206:28 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.206 export type BinaryFile = Buffer|Uint8Array|Blob|string|Readable;
Error: node_modules/aws-sdk/clients/sagemakerruntime.d.ts:227:26 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.227 export type PartBlob = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/schemas.d.ts:1184:22 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.1184 export type Body = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/ses.d.ts:1541:32 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.1541 export type RawMessageData = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/signer.d.ts:211:23 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.211 export type _Blob = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/sns.d.ts:391:24 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.391 export type Binary = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/ssm.d.ts:6819:48 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.6819 export type MaintenanceWindowLambdaPayload = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/synthetics.d.ts:221:23 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.221 export type _Blob = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/s3.d.ts:976:22 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.976 export type Body = Buffer|Uint8Array|Blob|string|Readable;
Error: node_modules/aws-sdk/clients/s3.d.ts:5705:15 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.5705 Payload?: Buffer;
Error: node_modules/aws-sdk/clients/textract.d.ts:1111:27 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.1111 export type ImageBlob = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/translate.d.ts:263:33 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.263 export type DocumentContent = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/translate.d.ts:981:43 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.981 export type TranslatedDocumentContent = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/wafregional.d.ts:740:39 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.740 export type ByteMatchTargetString = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/workmailmessageflow.d.ts:7:24 - error TS2307: Cannot find module 'stream' or its corresponding type declarations.
7 import {Readable} from 'stream';
Error: node_modules/aws-sdk/clients/workspaces.d.ts:1199:29 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.1199 export type DefaultLogo = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/workspaces.d.ts:2037:27 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.2037 export type Ios3XLogo = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/clients/workspacesweb.d.ts:652:42 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.652 export type CertificateAuthorityBody = Buffer|Uint8Array|Blob|string;
Error: node_modules/aws-sdk/lib/config-base.d.ts:2:35 - error TS2307: Cannot find module 'https' or its corresponding type declarations.
2 import {Agent as httpsAgent} from 'https';
Error: node_modules/aws-sdk/lib/dynamodb/document_client.d.ts:107:30 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.107 export type binaryType = Buffer|File|Blob|ArrayBuffer|DataView|Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|stream.Stream;
Error: node_modules/aws-sdk/lib/event-stream/event-stream.d.ts:1:55 - error TS2503: Cannot find namespace 'NodeJS'.
1 export interface StreamingEventStream extends NodeJS.ReadableStream {
Error: node_modules/aws-sdk/lib/http_response.d.ts:1:25 - error TS2307: Cannot find module 'stream' or its corresponding type declarations.
1 import * as stream from 'stream';
Error: node_modules/aws-sdk/lib/request.d.ts:1:25 - error TS2307: Cannot find module 'stream' or its corresponding type declarations.
1 import * as stream from 'stream';
Error: node_modules/aws-sdk/lib/request.d.ts:281:50 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
and then add 'node' to the types field in your tsconfig.281 onAsync(event: "httpData", listener: (chunk: Buffer|Uint8Array, response: Response<D, E>) => void, prepend?: boolean): Request<D, E>;
Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/
× Failed to compile. `
Reproduction Steps
I am reporting the issue
Possible Solution
No response
Additional Information/Context
none
SDK version used
3
Environment details (OS name and version, etc.)
Windows 11