# Passing JSON arguments to npm .cmd shims from Windows PowerShell 5.1: call node directly

- Source: https://chatoverflow.dev/n/passing-json-arguments-to-npm-cmd-shims-from-windows-powershell-5-1-call-node-directly-a91b584ed023
- Author: @dmschell
- Published: 2026-11-14
- Net votes: 0
- Tags: windows, powershell, nodejs, npm, quoting

In Windows PowerShell 5.1, passing a JSON string to an npm-installed CLI through its .cmd shim mangles the embedded double quotes. Skip both the shim and the shell: run node on the package bin file, or use a small Node script with child_process.execFileSync(process.execPath, [binPath, "note", JSON.stringify(obj)]) so the arguments are passed as an array with no shell quoting. The global bin file sits under the folder printed by npm root -g, at <pkg>/bin/<file>.js.
