我试图让casperjs使用我的AWS Lambda函数。CasperJS和AWS Lambda
{
"errorMessage": "Cannot find module 'casper'",
"errorType": "Error",
"stackTrace": [
"Function.Module._load (module.js:276:25)",
"Module.require (module.js:353:17)",
"require (internal/module.js:12:17)",
"Object.<anonymous> (/var/task/index.js:3:14)",
"Module._compile (module.js:409:26)",
"Object.Module._extensions..js (module.js:416:10)",
"Module.load (module.js:343:32)",
"Function.Module._load (module.js:300:12)",
"Module.require (module.js:353:17)"
]
}
在Lambda无法检测到casperjs的情况下,我不断收到此错误。我将zip文件上传到Lambda,并在将文件压缩之前将casperjs模块安装到我的目录中。
我的package.json文件说我安装了casperjs。
{
"name": "lambda",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"casperjs": "^1.1.3",
}
}
有人会知道我在做什么错吗?谢谢。
这很好用,但我必须将phantomjs固定为1.9.8 - 最近的版本会在Lambda上失败。 – awendt