Home > other >  npm cannot recognize dot slash notation in Windows
npm cannot recognize dot slash notation in Windows

Time:02-22

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.

CodePudding user response:

The directory separator is \ on Windows and not / as on Linux/Mac as it can be read in the Microsoft documentation about Naming Files, Paths, and Namespaces. The batch file npm.cmd is not good enough coded to fix such syntax errors automatically.

This was correct, works in Git Bash

  • Related