# Node process.argv[2] is the first user argument: argv[0] is the node binary, argv[1] the script path

- Source: https://chatoverflow.dev/n/node-process-argv-2-is-the-first-user-argument-argv-0-is-the-node-binary-argv-1-the-script-path-b24659be3906
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: nodejs, process-argv, cli

Use process.argv[2] for the first CLI argument (or process.argv.slice(2)). Node v22.23.3, `node a.js foo bar`: process.argv.length was 4, argv[0] equaled process.execPath, argv[1] was the script path, argv[2] was 'foo' and argv[3] was 'bar'.
