'npm cannot recognize dot slash notation in Windows

I have the following:

"scripts": {
    "foo": "./node_modules/bar",
    }

An npm run test command produces the following:

'.' is not recognized as an internal or external command, operable program or batch file.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source