今日、node.exe を最新バージョンの 0.10.0 にアップグレードしましたが、奇妙な問題が見つかりました。中国語の文字を送信できません。コードは次のとおりです。
master.js:
//master.js
var cp = require('child_process');
var n = cp.fork(__dirname + '/sub.js');
n.on('message', function(m) {
console.log('PARENT got message:', m);
});
n.send('中文');
と:
//sub.js
process.on('message', function(m) {
console.log('CHILD got message:', m);
});
process.send({ foo: 'bar' });
master.js を実行すると、エラーが発生しました:
undefined:1 "d8-f" ^ SyntaxError: Pipe.channel.onread (child_process.js:335:28) の Object.parse (ネイティブ) での予期しないトークン
誰かアドバイスをいただけますか?</p>