Tag: epipe

错误:写入EPIPE

我不断收到以下错误: Error: write EPIPE at errnoException (net.js:901:11) at Object.afterWrite (net.js:718:19) 当我运行以下function: router.route('/certificationService') .post(function (req, res) { var html = null, certificate = req.body.certificate, lang = req.body.lang, now = new Date(), dd = now.getDate(), mm = now.getMonth() + 1, yyyy = now.getFullYear(); if (dd < 10) dd = '0' + dd; if (mm < 10) mm […]

Node.js – events.js:154抛出err写入EPIPE; 程序崩溃

试图运行我的Node.js程序,这已经工作了很长时间,现在突然…不是。 我想弄清楚这个问题,我想如果我在这里贴出来试图追踪它会有帮助的。 这里是日志输出: events.js:154 throw er; // Unhandled 'error' event ^ Error: write EPIPE at exports._errnoException (util.js:856:11) at WriteWrap.afterWrite (net.js:767:14) 坦率地说,我不知道为什么它会抛出一个EPIPE错误,我检查了没有任何运行可能会干扰,它运行在一个完全相同的shell。 如果有什么我应该加上让我知道。

NodeJS – 如何stream缓冲请求主体

在下面的代码中,我不知道为什么req.pipe(res)不起作用,但也不会抛出一个错误。 一个预感告诉我,这是由于nodejs的asynchronous行为,但这是一个非常简单的情况下没有callback。 我错过了什么? http.createServer(function (req, res) { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.write('Echo service: \nUrl: ' + req.url); res.write('\nHeaders:\n' + JSON.stringify(req.headers, true, 2)); res.write('\nBody:\n'); req.pipe(res); // does not work res.end(); }).listen(8000); 这是curl: ➜ ldap-auth-gateway git:(master) ✗ curl -v -X POST –data "test.payload" –header "Cookie: token=12345678" –header "Content-Type:text/plain" localhost:9002 这是debugging输出(请参阅上传的主体): About to connect() to localhost port […]

错误:用node.js和imagemagick写EPIPE

我失去了这个错误的来源,我希望你能帮助我。 我是新来的节点,并试图调整与imagemagick图像: var express = require('express'), fs = require('fs'), gm = require('gm'), imagemagick = require('imagemagick'), var gm = require('gm').subClass({ imageMagick: true }); var app = express(); app.get('/', function (req, res) { console.log(__dirname + "/public/photos/4af1e720-a662-11e3-952c-61812ab60f67.jpg"); imagemagick.resize({ srcData: fs.readFileSync(__dirname + "/public/photos/4af1e720-a662-11e3-952c-61812ab60f67.jpg", 'binary'), width: "400" }, function(err,stdout,stderr){ if (err) console.log(err); fs.writeFile(__dirname + "/public/photos/thumbnail/4af1e720-a662-11e3-952c-61812ab60f67.jpg", stdout, 'binary'); }); }); 我得到以下内容: […]