TypeError AWS.KinesisVideo is not a constructor


TypeError AWS.KinesisVideo is not a constructor



I installed aws-sdk using the below command


npm install --save aws-sdk



and i get an error



TypeError AWS.KinesisVideo is not a constructor



for the below code


var kinesisvideo = new AWS.KinesisVideo();



AWS.IAM is not a constructor JavaScript SDK post mentioned the error could be because the KinesisVideo module isn't present.



My question is how do i install all modules of aws-sdk via npm.



Thanks




2 Answers
2



There are 2 main methods of downloading the full AWS SDK for browsers (load it in using a <script> tag) and Node.js backends.


<script>



Download a custom SDK from the AWS website



You can choose which modules and services to download in the online SDK builder at https://sdk.amazonaws.com/builder/js/



Click Select All Services and click Build to download everything.



Use the CLI to build the SDK



Clone the official AWS SDK GitHub repository.


<!-- language: lang-none -->

git clone git://github.com/aws/aws-sdk-js
cd aws-sdk-js



After you clone the repository, download the dependency modules for both the SDK and build tool via the following command:


npm install



You can now build a packaged version of the SDK from the command line interface.



Execute the following command to build the SDK with all services and API versions included:


node dist-tools/browser-builder.js all > aws-sdk-full.js



If you want a minified bundle, set the MINIFY environment variable.


MINIFY


MINIFY=1 node dist-tools/browser-builder.js > aws-sdk-full.js



*You must have Git and npm installed for this to work.



Extra resources:



https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/building-sdk-for-browsers.html



https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/installing-jssdk.html



https://github.com/aws/aws-sdk-js



https://www.npmjs.com/package/aws-sdk





That's the same approach i suggested ;)
– yeshashah
Jun 25 at 16:26



No. There is no way to install all modules together using npm.



But, You can use the SDK-builder tool from aws-sdk-js repo to create a minified bundle of ALL the AWS Services and include that bundle using <script> tag.


<script>



The command to generate a bundle of ALL the services:



node dist-tools/browser-builder.js all > aws-sdk-full.js


node dist-tools/browser-builder.js all > aws-sdk-full.js



Check out this link for full-steps.



Hope this helps.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

how to run turtle graphics in Colaboratory

Export result set on Dbeaver to CSV