Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR in node_modules/aws-sdk/lib/http_response.d.ts(1,25): error TS2307: Cannot find module 'stream' #273

Closed
samira-zarandioon opened this issue Dec 5, 2018 · 4 comments
Labels
amplify/cli Issues tied to CLI amplify/js Issues tied to JS

Comments

@samira-zarandioon
Copy link

Describe the bug
I was following the instructions in the following tutorial:
https://aws-amplify.github.io/docs/js/start?platform=ionic
After I ran the command 'amplify publish', I got the following error:

ERROR in node_modules/aws-sdk/lib/http_response.d.ts(1,25): error TS2307: Cannot find module 'stream'.
node_modules/aws-sdk/lib/http_response.d.ts(14,18): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try npm i @types/node.

I had to follow the instruction below to fix the issue:

https://stackoverflow.com/questions/43017736/integrating-aws-sdk-to-angular2-gives-cannot-find-module-stream

Adding "node" to types in tsconfig.app.json file that the angular-cli creates in the src directory as below:

{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "es2015",
"baseUrl": "",
"types": ["node"]
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}

I'm using mac:

$ npm -v
6.4.1
$ node -v
v10.14.1

@frankmuellr frankmuellr added the amplify/js Issues tied to JS label Dec 6, 2018
@meeximum
Copy link

I'm facing the same issue :-/

@playground
Copy link

Any update? I'm having the same issue when deploy to lambda.

@jordanranz jordanranz added amplify/cli Issues tied to CLI amplify/js Issues tied to JS and removed amplify/js Issues tied to JS labels Jun 7, 2019
@haverchuck
Copy link
Contributor

Adding "node" to the types array in compilerOptions is necessary and is mentioned in the documentation here. Make sure it's in the src/tsconfig.app.json file and not a different tsconfig.

@alengrace
Copy link

@haverchuck , it worked for me, Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
amplify/cli Issues tied to CLI amplify/js Issues tied to JS
Projects
None yet
Development

No branches or pull requests

7 participants