简体   繁体   中英

node.js process.memoryUsage() ENOENT

I just want to execute

console.log(process.memoryUsage())

in test.js with

node test.js

In my localhost it works perfectly, but on my server it generates the following error:

console.log(process.memoryUsage())
                ^
Error: ENOENT, no such file or directory
at Error (native)
at Object.<anonymous> (directory/test.js:4:21)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3

I'm using node v0.12.2. Any ideas why this error occurs?

正如我在评论中提到的,它可能是因为os中的用户权限而发生的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM