Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

process.getuid() not working on Windows

I created a script containing only a single line of code:

console.log('userid: ' + process.getuid());

When I run the script using the command node filename.js, following error occurs:

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)

I am running node.js on Windows.

like image 781
tech-man Avatar asked Apr 27 '12 19:04

tech-man


1 Answers

Old question I know but thought I would tidy this up incase anyone else is searching.

Just checking through the docs it would seem that:

Note: this function is only available on POSIX platforms (i.e. not Windows)

Cheers

John

like image 158
antz29 Avatar answered Sep 22 '22 21:09

antz29