Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while running a Node js program

I have written a node js program which contained a method called AWS.config.update(). When I tried to run it on terminal, I got an error:

Error: Cannot find module 'aws-sdk'

like image 379
Lisa Avatar asked Dec 18 '22 20:12

Lisa


2 Answers

Go to the folder where your node application is installed:

cd location/to/your/folder

And then run this to install the aws-sdk:

npm install aws-sdk

like image 69
Akeshwar Jha Avatar answered Dec 30 '22 11:12

Akeshwar Jha


After npm install aws-sdk be sure that your package.json specifies the exact version of the new dependency, such as:

"dependencies": {
    "aws-sdk": "2.4.12",
like image 39
dnaxxx Avatar answered Dec 30 '22 10:12

dnaxxx