99x / serverless-dynamodb-local

Serverless Dynamodb Local Plugin - Allows to run dynamodb locally for serverless
MIT License
624 stars 233 forks source link

`Error getting DynamoDb local latest tar.gz location: 301` #213

Open lintdeveloper opened 5 years ago

lintdeveloper commented 5 years ago

Good morning, I am getting Error: Error getting DynamoDb local latest tar.gz location: 301 after doing installing serverless-dynamodb-local. What am I getting wrong, although I have java installed on my PC.

Here is the full description of the error message

Error: Error getting DynamoDb local latest tar.gz location: 301
    at ClientRequest.<anonymous> (C:\Users\Mussa\Documents\ServerlessSafari\rest-api\node_modules\dynamodb-localhost\dynamodb\installer.js:14:26)
    at Object.onceWrapper (events.js:315:30)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:551:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)
    at Socket.socketOnData (_http_client.js:440:20)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at TCP.onread (net.js:594:20)
_http_client.js:131
    throw new Error('Protocol "' + protocol + '" not supported. ' +
    ^

Error: Protocol "https:" not supported. Expected "http:"
    at new ClientRequest (_http_client.js:131:11)
    at request (http.js:38:10)
    at Object.get (http.js:42:13)
    at ClientRequest.<anonymous> (C:\Users\Mussa\Documents\ServerlessSafari\rest-api\node_modules\dynamodb-localhost\dynamodb\installer.js:16:18)
    at Object.onceWrapper (events.js:315:30)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:551:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)
    at Socket.socketOnData (_http_client.js:440:20)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at TCP.onread (net.js:594:20)
bearsworth commented 5 years ago

You are doing nothing wrong. I too am having the issue and I think I've figured out the problem. However the best work around would be to revert back to the 0.2.35 version of the package. The newer version they used a redirect to get the installation but the thing is its working with no redirect so pretty much it throws an error.

More specifically I think the issue is in the installer.js where it says if (302 != response...). The problem is right now the link would throw a response status of 200 of OK, and because that's the first conditional statement, the condition throws an error.

azizur commented 5 years ago

@lintdeveloper did you accidentally install serverless-dynamodb-local@1.0.2 because npm thinks that's the latest version of the package.

Try switching to 0.2.37.

I hope #218 will address this kind of confusions.

thekensman commented 5 years ago

This just saved me a ton of time - thank you