nw.js: process.cwd() returns wrong path

Shouldn’t process.cwd() return the directory the user is currently at? It seems to always return the path where the app source lives regardless of where the user is running it from.

<bountysource-plugin>

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 27 (3 by maintainers)

Most upvoted comments

The problem still exists. Are there some clues for its solution?

When I run nw app/, process.cwd() return the right path. But after i package my app with grunt-node-webkit-builder, the process.cwd return a wrong path.

It should not return like this:

C:\Users\ADMINI~1\AppData\Local\Temp\nw7936_5644 

It should return: (nw.exe is in test folder)

C:\Users\Administrator\test

Do I miss something important? How to fix it?

Will provide a way. Thanks.