Coder Social home page Coder Social logo

Comments (7)

tmitchel2 avatar tmitchel2 commented on July 20, 2024

Hi Steve,

Are you running locally using npm run start or running on aws lambda?

When you run locally it will use the dist folder not the actual packaged zip. Double check the Winston folder is there under dist/node_modules/winston.

If it is there then I think the directory you are running the npm run start from is not what I expect it to be which is the dynamodb-lambda-autoscale root folder. Please see line 4 of /scripts/start.js to understand why the starting folder is expected to be the root one.

from dynamodb-lambda-autoscale.

steveparker-optimise avatar steveparker-optimise commented on July 20, 2024

Sorry should have been clearer. I'm only running it on AWS. My exact steps were:

Clone repo
CD to root directory
npm install
npm run build
upload dist.zip as a new function (with described role)

from dynamodb-lambda-autoscale.

tmitchel2 avatar tmitchel2 commented on July 20, 2024

Let me take a look tonight once I get back to my mac.

from dynamodb-lambda-autoscale.

tmitchel2 avatar tmitchel2 commented on July 20, 2024

I think it's the permissions that have been set on your node_modules folder. When I download and extract the zip onto my mac I can't even cd into the node_modules folder to see its content. I presume aws lambda is having the same issue. Im not sure why this would be the case, perhaps something todo with your default permissions? Even if you can access the folder it might be that all other users cant..

Im contemplating removing the only node_module dependency (winston) anyway.

from dynamodb-lambda-autoscale.

brendonparker avatar brendonparker commented on July 20, 2024

I also had some challenge getting this working when running locally using npm start run. Best I can tell, the dotenv package is failing to set the aws access keys. When I debug, it looks like any attempt to set process.env properties at run-time does nothing (doesn't throw an exception, but also doesn't set the value).

I'm running on Windows - don't know if that is to blame.

I was able to get it to work if I added the access keys to the package.json start script command.

from dynamodb-lambda-autoscale.

tmitchel2 avatar tmitchel2 commented on July 20, 2024

I think your issue is slightly different, I haven't tested windows compatibility. It looks related to motdotla/dotenv#83 and I've opened another issue to cover windows compatibility here #3

from dynamodb-lambda-autoscale.

tmitchel2 avatar tmitchel2 commented on July 20, 2024

I just made a commit 357123d which removes all node_modules (i.e. winston) and changes the .env file to config.env. This should sort both your issues. Please let me know if you still get issues though as I haven't been able to test this on a windows machine.

from dynamodb-lambda-autoscale.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.