gpt4 book ai didi

javascript - process.getuid() 不适用于 Windows

转载 作者:数据小太阳 更新时间:2023-10-29 05:08:30 26 4
gpt4 key购买 nike

我创建了一个只包含一行代码的脚本:

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

当我使用命令 node filename.js 运行脚本时,出现以下错误:

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)

我在 Windows 上运行 node.js。

最佳答案

我知道的老问题,但我想我会整理一下以防其他人正在搜索。

只是检查the docs看起来:

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

干杯

约翰

关于javascript - process.getuid() 不适用于 Windows,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10356814/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com