Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-compat: process.argv0 #20934

Closed
chibat opened this issue Oct 18, 2023 · 3 comments · Fixed by #22555
Closed

node-compat: process.argv0 #20934

chibat opened this issue Oct 18, 2023 · 3 comments · Fixed by #22555
Assignees
Labels
bug Something isn't working correctly node compat

Comments

@chibat
Copy link
Contributor

chibat commented Oct 18, 2023

The result when explicitly specifying the process name is different from Node.js.
I did a test with a canary release.

Node

$ bash -c 'exec -a customArgv0 node'
> process.argv0
'customArgv0'

Deno

$ deno --version
deno 1.37.2+5095af7 (canary, x86_64-unknown-linux-gnu)
v8 11.8.172.13
typescript 5.2.2
$ bash -c 'exec -a customArgv0 deno'
> import process from "node:process"
undefined
> process.argv0
"deno"

related issue: #20924
related PR: #20925

@birkskyum
Copy link
Contributor

Closed by

@chibat
Copy link
Contributor Author

chibat commented Oct 24, 2023

The fix in PR #20925 does not produce the same results as Node.js.

@satyarohith satyarohith reopened this Feb 23, 2024
@satyarohith satyarohith added bug Something isn't working correctly node compat labels Feb 23, 2024
@satyarohith
Copy link
Member

This is still an issue with the latest version of deno:

➜  ~ bash -c 'exec -a customArgv0 node'
Welcome to Node.js v21.5.0.
Type ".help" for more information.
> process.argv0
'customArgv0'
> .exit
➜  ~ bash -c 'exec -a customArgv0 deno'
Deno 1.40.5
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
> import process from "node:process"
undefined
> process.argv0
"deno"
>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants