0
我有以下Node.js的文件:node.js的 “不确定” 神秘出现
//test.js:
var hash=require('./hash');
var sys=require('sys');
sys.puts(hash.hash("asdf","asdf"));
和
//hash.js:
var exec=require('child_process').exec;
var sys=require('sys');
exports.hash=function(data,hash_type){
exec('pwd',function callback(error,stdout,stderr){
sys.puts(stdout);
});
}
当我做node test.js
,我得到下面的输出:
[email protected]:~/Desktop/simple-hash$ node test.js
undefined
/home/hynese/Desktop/nodejs-simple-hash
为什么我得到“undefined”?我真的卡在这里...
任何帮助,非常感谢。
提前许多感谢,
Doh! *刘海桌子* *非常感谢... – Eamorr
@Eamorr,一种快乐:) – davin