Tôi tạo ra một kịch bản chỉ chứa một dòng mã:process.getuid() không làm việc trên Windows
console.log('userid: ' + process.getuid());
Khi tôi chạy kịch bản bằng cách sử dụng lệnh node filename.js
, lỗi sau xảy ra:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object #<EventEmitter> has no method 'getuid'
at Object.<anonymous> (c:\PROGRA~1\nodejs\node_modules\mrt\p.js:1:96)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)
Tôi đang chạy node.js trên Windows.
Dòng mã đơn lẻ đó sẽ tự hoạt động tốt. Phiên bản nào bạn đang sử dụng? – maerics
Tôi đã tải xuống phiên bản mới nhất; v0.6.15 –
Tôi kiểm tra lại mọi thứ nhưng lỗi tồn tại. Nó là một lỗi trong nút ?! –