Comments (30)
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.
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:
- Uninstall
serverless-dynamodb-local
, e.g.npm uninstall serverless-dynamodb-local
- Install
serverless-dynamodb
, e.g.npm install serverless-dynamodb
- Update references in your code, including your serverless config, from
serverless-dynamodb-local
toserverless-dynamodb
(quite possible that you won't have any, as you just refer to it from your serverless config) - (optional) Update your serverless config custom
dynamodb
key toserverless-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.
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.
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.
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:
node_modules\dynamodb-localhost\dynamodb\config.json change http to https
Maybe this will solve your problem
from serverless-dynamodb-local.
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.
@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.
@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.
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.
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.
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.
In the meantime, manually editing the
download_url
innode_modules/dynamodb-localhost/dynamodb/config.json
tohttps://s3.us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz
and the import ofhttp
tohttps
innode_modules/dynamodb-localhost/dynamodb/installer.js
should do the trick!
They should really make this configurable.
from serverless-dynamodb-local.
@jespinal you could use patch-package for that
Edit: adding the link
from serverless-dynamodb-local.
Do we have fix this as of now ?
from serverless-dynamodb-local.
man, this long and no fix? this is annoying
from serverless-dynamodb-local.
@ehtesham1996 Seems like it. I guess a fork would be a viable option
from serverless-dynamodb-local.
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.
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.
@matAlmeida Thanks, we will wait for the new release then.
from serverless-dynamodb-local.
@benjiJanssens it worked !! thanks a lot !
from serverless-dynamodb-local.
any update on this issue? it's blocking our CI.
youre not alone :')
from serverless-dynamodb-local.
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.
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.
any update on this issue? it's blocking our CI.
from serverless-dynamodb-local.
Sad nothing happens :(
from serverless-dynamodb-local.
In the meantime, manually editing the
download_url
innode_modules/dynamodb-localhost/dynamodb/config.json
tohttps://s3.us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz
and the import ofhttp
tohttps
innode_modules/dynamodb-localhost/dynamodb/installer.js
should do the trick!
It worked for me! Thanks!
from serverless-dynamodb-local.
Any ETA on when this is going to get published?
from serverless-dynamodb-local.
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.
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.
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.
Thank youu!
from serverless-dynamodb-local.
Related Issues (20)
- Windows: Serverless command "dynamodb install" not found. HOT 8
- Deprecation warning: CLI options definitions were upgraded with "type" property HOT 6
- Global Secondary Index is not working HOT 3
- WSL2 Unable to start DynamoDB Local process! HOT 2
- Cannot launch DynamoDB on Mac M1 architecture HOT 15
- Getting "UnknownError: Service Unavailable" while trying to run the local server using command "sls dynamodb start"
- Plugin not working after upgrading to SLS v3 HOT 2
- Can I upgrade schemas?
- Issue with default region on Localstack 1.1
- CLI_OPTIONS_SCHEMA_V3 deprecation support
- Semantic version inconsistency HOT 1
- Create table for offline mode only
- Unexpected key `ContributorInsightsSpecification` HOT 2
- migrate does not work with higher version of node over 16 HOT 4
- sls dynamodb install failing to download HOT 1
- Please deploy the new version that fixes the http -> https thing on the dynamodb-local package. HOT 1
- Invalid AWS Mock Access Key ID through a new AWS-SDK version HOT 5
- The latest version installed by npm is different than what is in the repo HOT 1
- Crashing after update to MacOS 14.5 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless-dynamodb-local.