Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

child_process.spawn optional arguments #6068

@alexwhitman

Description

@alexwhitman

The documentation for child_process.spawn() (http://www.nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) suggests that both the args and options arguments are optional. However spawn('ls', { cwd: process.cwd() }) errors with

child_process.js:699
  args = args ? args.slice(0) : [];
                     ^
TypeError: Object #<Object> has no method 'slice'

It can be worked around with spawn('ls', [], { cwd: process.cwd() }).

This is on 0.10.16.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions