在运行Node的lambda中是否支持dynamodb-geo?

问题描述 投票:0回答:1

我正在尝试在此article之后创建一个简单的应用程序,但无法获得Node Lambda函数来查找dynamodb-geo软件包。

这是我所拥有的:

const AWS = require('aws-sdk');
const ddbGeo = require('dynamodb-geo');

exports.handler = async (event, context) => {
  // Rest of the code here
};

Lambda抛出的错误是:

START RequestId:5d40d132-040f-447d-bd76-3​​5c4cec0236a版本:$ LATEST2019-10-05T10:04:24.719Z未定义错误未捕获异常{“ errorType”:“ Runtime.ImportModuleError”,“ errorMessage”:“错误:找不到模块'dynamodb-geo'“,”堆栈“:[” Runtime.ImportModuleError:错误:无法在_loadUserApp中找到模块'dynamodb-geo'“,”(/var/runtime/UserFunction.js:100:13)“,”在Object.module.exports.load(/var/runtime/UserFunction.js:140:17)“,”在对象。 (/var/runtime/index.js:45:30)“,”在Module._compile(internal / modules / cjs / loader.js:778:30)“,”在Object.Module._extensions..js(internal / modules / cjs / loader.js:789:10)“,”在Module.load(internal / modules / cjs / loader.js:653:32)“,”在tryModuleLoad(internal / modules / cjs / loader.js:593:12)“,”在Function.Module._load(internal / modules / cjs / loader.js:585:3)“,”在Function.Module.runMain(internal / modules / cjs / loader.js:831:12)“,”在启动时(internal / bootstrap / node.js:283:19)“]} END RequestId:5d40d132-040f-447d-bd76-3​​5c4cec0236a报告RequestId:5d40d132-040f-447d-bd76-3​​5c4cec0236a时长:1146.75 ms已结算持续时间:1200 ms内存大小:512 MB使用的最大内存:35 MB未知发生应用程序错误Runtime.ImportModuleError

关于可能发生的事情的任何线索?

node.js amazon-web-services aws-lambda amazon-dynamodb geohashing
1个回答
0
投票

您安装了软件包吗?

使用npm或纱线:npm install --save dynamodb-geoyarn add dynamodb-geo

文档:https://www.npmjs.com/package/dynamodb-geo

© www.soinside.com 2019 - 2024. All rights reserved.