You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Certain software such as docker or VS Code relies on the actual path, not real path. In case we use NodeJS based scripts - we would like to know from what actual folder this code is running. Unfortunately process.cwd( ) does not work. This code node -p 'process.cwd()' returns path without symlink. Flags like --preserve-symlinks or NODE_PRESERVE_SYMLINKS=1 do not help to solve the problem.
What is the feature you are proposing to solve the problem?
Please introduce a flag and what is more important environment variable to force process.cwd to follow the actual path, not realpath.
Environment variable is needed for scenarios when we cannot already change scripts, but we can force node to work different by changing it.
What alternatives have you considered?
Alternative solution now is to use process.env.PWD, but it's OS dependent, so will not work in Windows
Seem to break docker containers with LTS node, works if rolling back to node:23.3.0.
Not sure if it's when I do (with shelljs npm library) or some of fs, heapsnapshot, etc. that does it, but multiple ones utilize either '/srv' as a string or process.cwd().
I did sh into the container and it seem to respond to cd /srv regardless of location in the container, but Node keeps restarting saying it cannot find the /srv folder.
What is the problem this feature will solve?
Certain software such as docker or VS Code relies on the actual path, not real path. In case we use NodeJS based scripts - we would like to know from what actual folder this code is running. Unfortunately process.cwd( ) does not work. This code
node -p 'process.cwd()'
returns path without symlink. Flags like--preserve-symlinks
orNODE_PRESERVE_SYMLINKS=1
do not help to solve the problem.What is the feature you are proposing to solve the problem?
Please introduce a flag and what is more important environment variable to force process.cwd to follow the actual path, not realpath.
Environment variable is needed for scenarios when we cannot already change scripts, but we can force node to work different by changing it.
What alternatives have you considered?
Alternative solution now is to use process.env.PWD, but it's OS dependent, so will not work in Windows
Related issues
This will solve directly this issue:
devcontainers/cli#932
And as a result will help to solve following problems:
microsoft/vscode-remote-release#10301
docker/for-win#14380
Thanks!
The text was updated successfully, but these errors were encountered: