Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

124
Views
El script PS de ejecución del nodo antepone las opciones que fallan

exec('command', {'shell':'powershell.exe'}, (error, stdout, stderr) => { ... } falla con el siguiente error:

 /d : The term '/d' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + /d /s /c command + ~~ + CategoryInfo : ObjectNotFound: (/d:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

¿Qué es anteponer /d /s /c y cómo se puede prevenir?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

  • Su síntoma implica que está utilizando una versión anterior de Node.js.

  • Actualice al menos a v11.15.0 para que su código funcione.

En versiones anteriores, las opciones de la línea de comandos /d /s /c se usaban invariablemente , independientemente del ejecutable que haya especificado para shell , y dado que powershell.exe no comprende estas opciones, los comandos fallaban invariablemente.

Desde v11.15.0, -c ahora se usa para cualquier shell que no sea cmd.exe , que PowerShell sí entiende.

Puede usar el siguiente comando de prueba de PowerShell para ver si su versión de Node.js es lo suficientemente reciente:

 # Run from PowerShell. # If your Node.Js version is recent enough, you'll see PowerShell's version info, # otherwise, an error will occur. node -pe "child_process.execSync('`$PSVersionTable', { shell: 'powershell.exe' }).toString()"
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!