Skip to content

Failing to determine 'cd' alone as a command in Windows #30

Description

@KSR4599

The module is failing to determine 'cd' (without parameters) as a command in windows.

var commandExistsSync = require('command-exists').sync;
var cmd = 'cd';
console.log("Check for cd : "+ commandExistsSync(cmd));

Output in Windows (Node v6.17.1) :

Check for cd: false

But, cd is indeed a valid command which when used without any parameters displays the current drive and directory. Whereas, other standalone commands such as dir, pwd, ls.. tends to be recognized as valid commands.

Tested and observed this behavior on recent version of node (v14.15.0) and older versions as well ( v6.17.1 , v8.17.0 and v12.13.0).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions