Skip to content

[BUG] npm on windows can't run scripts with ".", relative paths "../" #2880

Closed
@DavidHenri008

Description

@DavidHenri008

Current Behavior:

On windows npm cannot run scripts like

"build": "../node_modules/.bin/tsc",
Error:
'..' is not recognized as an internal or external command,
operable program or batch file.

Replacing with ..\ makes it work.

Expected Behavior:

The string should be converted to make it cross-platform.
As a note, it does work with Yarn.

Steps To Reproduce:

Place in script task something with "../" or "./" on WINDOWS.

Environment:

npm: '7.6.2',
node: '14.4.0',

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingRelease 7.xwork is associated with a specific npm 7 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions