Javascript nodejs lambda epipe错误
我收到这个错误&找不到任何原因 我已经在AmazonAWS上部署了这段代码。这是由于代码的异步执行造成的吗??Stackoverflow要求我添加更多细节,但我没有比这更多的 下面是我的代码的快照Javascript nodejs lambda epipe错误,javascript,node.js,amazon-web-services,lambda,Javascript,Node.js,Amazon Web Services,Lambda,我收到这个错误&找不到任何原因 我已经在AmazonAWS上部署了这段代码。这是由于代码的异步执行造成的吗??Stackoverflow要求我添加更多细节,但我没有比这更多的 下面是我的代码的快照 "Error: write EPIPE at Object.exports._errnoException (util.js:870:11) at exports._exceptionWithHostPort (util.js:893:20) at WriteWrap
"Error: write EPIPE
at Object.exports._errnoException (util.js:870:11)
at exports._exceptionWithHostPort (util.js:893:20)
at WriteWrap.afterWrite (net.js:763:14)"
module.exports.register = function(client, body, s, rclient, redis, callback){
console.log("inside registration module function");
console.log(body);
console.log("mobile no", body.mobile_no);
client.connectAsync()
.then(()=>
{
return client.queryAsync('select count(*) from users where mobile_no=$1',[body.mobile_no]);})
.then(res=>{
console.log("connection successful");
if(res.rows[0].count==0)
{
return client.queryAsync('insert into users(mobile_no, email, city, uname, password) values ($1, $2, $3, $4, $5)', [body.mobile_no, body.email, body.city, body.uname, body.password])
.then(()=>{
return client.queryAsync('select uid from users where mobile_no=$1',[body.mobile_no]);
})
.then(res=>{
var uid = JSON.stringify(res);
uid = JSON.parse(uid).rows[0].uid;
console.log("uid: ", uid);
console.log(uid);
console.log(s);
rclient.set(s,uid,redis.print);
const response = {
statusCode:201,
body: JSON.stringify({
sid: s,
message: 'user registered',
}),
};
console.log('success');
return Promise.promisify(response);
})
.then(res=>{
callback(null, res);
})
}
else
{
console.log("It is already registered mobile no");
const response = {
statusCode:412,
body: JSON.stringify({
sid: '',
message: 'error: mobile no already registered',
}),
};
Promise.promisify(response);
}
})
.then(res=>{
callback(null, res);
})
.then(()=>{
client.end();
rclient.quit();
})
.catch(err=>{
console.log(err.stack);
console.log("error occured");
})
}
节点版本为
v4.3.2
已知该错误,请下载最新版本。使用LTS版本(6.10.0)
或最新版本(即7.7.3
),该版本将不再保留。这些版本是稳定的,应该可以工作。节点版本是v4.3.2
已知该错误,请下载最新版本。使用LTS版本(6.10.0)
或最新版本(即7.7.3
),该版本将不再保留。这些版本是稳定的,应该可以工作。错误产生在哪里?当管道连接到封闭的流时引发的EPIPE错误是您的节点版本<=到节点v0.6.16,我的节点版本是v4.3.2。api有时会正常执行。但是,有时它会给出上面的错误,错误产生在哪里?当管道连接到封闭的流时抛出的EPIPE错误是您的节点版本<=节点v0.6.16,我的节点版本是v4.3.2。api有时会正常执行。但是,有时它会给出上述错误,亚马逊目前不支持版本nodejs version6。因此,这不可能是一个解决方案,因为最新的亚马逊现在支持samazon,但目前不支持nodejs版本6。所以,这不可能是一个解决方案。这是亚马逊现在最新的支持