Git Product home page Git Product logo

Comments (30)

benjidotsh avatar benjidotsh commented on June 16, 2024 160

In the meantime, manually editing the download_url in node_modules/dynamodb-localhost/dynamodb/config.json to https://s3.us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz and the import of http to https in node_modules/dynamodb-localhost/dynamodb/installer.js should do the trick!

from serverless-dynamodb-local.

domdomegg avatar domdomegg commented on June 16, 2024 44

FYI: This package (serverless-dynamodb-local) doesn't appear to be maintained, with no new releases to NPM in over 2 years. Despite our pleas, I don't think this is getting deployed anytime soon. Over time, I think solutions that require creative uses of patch-package or sed will become fragile, and are a pain to maintain on each repo.

Solution: You can use serverless-dynamodb, a maintained fork, instead. (Disclaimer: I am a contributor to this fork). It is a drop-in replacement for this package, and is updated to fix this bug. This is a drop-in replacement for serverless-dynamodb-local, so to upgrade simply:

  1. Uninstall serverless-dynamodb-local, e.g. npm uninstall serverless-dynamodb-local
  2. Install serverless-dynamodb, e.g. npm install serverless-dynamodb
  3. Update references in your code, including your serverless config, from serverless-dynamodb-local to serverless-dynamodb (quite possible that you won't have any, as you just refer to it from your serverless config)
  4. (optional) Update your serverless config custom dynamodb key to serverless-dynamodb

Of course, it's all still open-source and MIT licensed. Ownership of this new package sits with a registered charity, that is committed to maintaining the package into the future and is open to contributions from the community.

There's an explanation as to the intentions behind this fork, and how it compares to other forks in the README.

In any case would be open to feedback on the fork - can drop create an issue in that repository or email me (address on profile).

from serverless-dynamodb-local.

cnuss avatar cnuss commented on June 16, 2024 23

I've found a less-hacky way of getting the URL to update, and considering you're using NPM 8.3.0+ (also worked with yarn 1.22)

NOTE: I needed to clear my node_modules / build cache for this to work:

package.json:

  "devDependencies": {
      ...
      "serverless-dynamodb-local": "...",
      ...
  },
  "overrides": {
    "serverless-dynamodb-local": {
      "dynamodb-localhost": "https://github.com/99x/dynamodb-localhost#db30898f8c40932c7177be7b2f1a81360d12876d"
    }
  }

Ref: 99x/dynamodb-localhost#78
Ref: https://stackoverflow.com/questions/15806152/how-do-i-override-nested-npm-dependency-versions

from serverless-dynamodb-local.

ovitor38 avatar ovitor38 commented on June 16, 2024 17

I had the same issue when trying to run a project. What helped me was changing two files from the node_modules/dynamodb-localhost folder.

In node_modules\dynamodb-localhost\dynamodb\installer.js change http to https:

2023-03-30_17-47

node_modules\dynamodb-localhost\dynamodb\config.json change http to https
image
Maybe this will solve your problem

from serverless-dynamodb-local.

matAlmeida avatar matAlmeida commented on June 16, 2024 14

I'm getting the same error, apparently AWS changed the domain to https://s3.us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz

Edit:
The fix was done in dynamodb-localhost project but not published yet

from serverless-dynamodb-local.

benjidotsh avatar benjidotsh commented on June 16, 2024 5

@cnuss you're in the wrong repo 😄 as soon as dynamodb-localhost gets a new release on npm, we can integrate the changes into serverless-dynamodb-local

from serverless-dynamodb-local.

cnuss avatar cnuss commented on June 16, 2024 4

@AshanFernando hey there! now that 99x/dynamodb-localhost#78 is merged, could we get a release to NPM which includes the fix?

from serverless-dynamodb-local.

jespinal avatar jespinal commented on June 16, 2024 4

To whom it may concern:

I faced this issue last week and CircleCI was really not liking it. I ended up adding the following in the scripts section of the packages.json file of the repo I was working with:

  "scripts": {
    "postinstall": "sed -i 's|http://s3-us-west-2|https://s3-us-west-2|g' ./node_modules/dynamodb-localhost/dynamodb/config.json && sed -i 's|require(\"http\")|require(\"https\")|g' ./node_modules/dynamodb-localhost/dynamodb/installer.js",
...
  },

Is it a bit hacky? yes, but I can get over it for now. I'm using sed to modify 2 files.

from serverless-dynamodb-local.

cnuss avatar cnuss commented on June 16, 2024 4

I've found a less-hacky way of getting the URL to update, and considering you're using NPM 8.3.0+ (also worked with yarn 1.22)

NOTE: I needed to clear my node_modules / build cache for this to work:

package.json:

  "devDependencies": {
      ...
      "serverless-dynamodb-local": "...",
      ...
  },
  "overrides": {
    "serverless-dynamodb-local": {
      "dynamodb-localhost": "https://github.com/99x/dynamodb-localhost#db30898f8c40932c7177be7b2f1a81360d12876d"
    }
  }

Ref: 99x/dynamodb-localhost#78 Ref: https://stackoverflow.com/questions/15806152/how-do-i-override-nested-npm-dependency-versions

I missed a line in my original comment, it also needs to be set in devDependencies for full integration

  "devDependencies": {
      ...
      "dynamodb-localhost": "https://github.com/99x/dynamodb-localhost#db30898f8c40932c7177be7b2f1a81360d12876d"
      ...
      "serverless-dynamodb-local": "...",
      ...
  },
  "overrides": {
    "serverless-dynamodb-local": {
      "dynamodb-localhost": "https://github.com/99x/dynamodb-localhost#db30898f8c40932c7177be7b2f1a81360d12876d"
    }
  }

Also found some issues with ourdering so make sure dynamodb-localhost is before serverless-dynamodb-local in devDependencies.

from serverless-dynamodb-local.

ehtesham1996 avatar ehtesham1996 commented on June 16, 2024 4

man, this long and no fix? this is annoying

Last publish of the library was 2 years. Should we consider it as dead ?

from serverless-dynamodb-local.

dev-cyprium avatar dev-cyprium commented on June 16, 2024 3

In the meantime, manually editing the download_url in node_modules/dynamodb-localhost/dynamodb/config.json to https://s3.us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz and the import of http to https in node_modules/dynamodb-localhost/dynamodb/installer.js should do the trick!

They should really make this configurable.

from serverless-dynamodb-local.

BigsonLvrocha avatar BigsonLvrocha commented on June 16, 2024 2

@jespinal you could use patch-package for that

Edit: adding the link

from serverless-dynamodb-local.

ehtesham-turn avatar ehtesham-turn commented on June 16, 2024 2

Do we have fix this as of now ?

from serverless-dynamodb-local.

bitsofinfo avatar bitsofinfo commented on June 16, 2024 2

man, this long and no fix? this is annoying

from serverless-dynamodb-local.

RodPaDev avatar RodPaDev commented on June 16, 2024 2

@ehtesham1996 Seems like it. I guess a fork would be a viable option

from serverless-dynamodb-local.

HannahNguyen6729 avatar HannahNguyen6729 commented on June 16, 2024 2

In the meantime, manually editing the download_url in node_modules/dynamodb-localhost/dynamodb/config.json to https://s3.us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz and the import of http to https in node_modules/dynamodb-localhost/dynamodb/installer.js should do the trick!

thank you so much:
I fix it

from serverless-dynamodb-local.

juheba avatar juheba commented on June 16, 2024 2

This issue appears to have been fixed in the latest release without need for any manual editing or switching the config json values
On wich dependency is this fixe released?

The newest version via npm is serverless-dynamodb-local 0.2.40 and uses dynamodb-localhost 0.0.9 still with the old url.

As matAlmeida commented on Mar 8: PR 99x/dynamodb-localhost#78 merged but is not released yet.

In the comments are some suggestions provided on how to fix the issue:

  • benjidotsh commented on Mar 9 --> manually modify two files in node_modules/dynamodb-localhost and replace http to https
  • cnuss commented on Apr 2 --> add dynamodb-localhost from github containing the fix to dev dependencies
  • jespinal commented on Mar 31 --> add a postinstall script to package.json with sed commands to modify two files in node_modules/dynamodb-localhost and replace http to https

I used the command from jespinal:

sed -i 's|http://s3-us-west-2|https://s3-us-west-2|g' ./node_modules/dynamodb-localhost/dynamodb/config.json && sed -i 's|require(\"http\")|require(\"https\")|g' ./node_modules/dynamodb-localhost/dynamodb/installer.js

from serverless-dynamodb-local.

maher-rddi avatar maher-rddi commented on June 16, 2024 1

@matAlmeida Thanks, we will wait for the new release then.

from serverless-dynamodb-local.

maher-rddi avatar maher-rddi commented on June 16, 2024 1

@benjiJanssens it worked !! thanks a lot !

from serverless-dynamodb-local.

cidit avatar cidit commented on June 16, 2024 1

any update on this issue? it's blocking our CI.

youre not alone :')

from serverless-dynamodb-local.

Douglasblnk avatar Douglasblnk commented on June 16, 2024 1

I have a doubt, why using pnpm the folder dynamodb-localhost is not created? I can't do the trick to change download_url with pnpm.

from serverless-dynamodb-local.

cnuss avatar cnuss commented on June 16, 2024

you're in the wrong repo

it appears 99x/serverless-dynamodb-local and 99x/dynamodb-localhost are maintained and released by the same individual(s) so I pinged here since this is the final(ish) destination 😄

from serverless-dynamodb-local.

kylevillegas93 avatar kylevillegas93 commented on June 16, 2024

any update on this issue? it's blocking our CI.

from serverless-dynamodb-local.

scottbasgaard avatar scottbasgaard commented on June 16, 2024

Sad nothing happens :(

from serverless-dynamodb-local.

alejandroch1202 avatar alejandroch1202 commented on June 16, 2024

In the meantime, manually editing the download_url in node_modules/dynamodb-localhost/dynamodb/config.json to https://s3.us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz and the import of http to https in node_modules/dynamodb-localhost/dynamodb/installer.js should do the trick!

It worked for me! Thanks!

from serverless-dynamodb-local.

RodPaDev avatar RodPaDev commented on June 16, 2024

Any ETA on when this is going to get published?

from serverless-dynamodb-local.

aaaronme avatar aaaronme commented on June 16, 2024

I fixed it by simply copying over the .dynamodb folder into the root from another project where I had already run sls dynamodb install before

from serverless-dynamodb-local.

colesiegel avatar colesiegel commented on June 16, 2024

I have a doubt, why using pnpm the folder dynamodb-localhost is not created? I can't do the trick to change download_url with pnpm.

Doesn't work for me either

from serverless-dynamodb-local.

one-tonne-mee avatar one-tonne-mee commented on June 16, 2024

This issue appears to have been fixed in the latest release without need for any manual editing or switching the config json values

from serverless-dynamodb-local.

SweetRiot avatar SweetRiot commented on June 16, 2024

Thank youu!

from serverless-dynamodb-local.

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.