Skip to content

vscode does not run npm script names with whitespaces #113750

Closed

Description

  • VSCode Version: 1.52.1
  • OS Version: Windows 10 10.0.19042 build 19042

Steps to Reproduce:

  1. Create a new node project
  2. Add a script in the package.json with whitespaces in the key name
  3. Try to run it from the "scripts" panel

Does this issue occur when all extensions are disabled?: Yes

I have these scripts defined in the package.json

 "scripts": {
        //...
        "[test] unit": "jest src/.*.unit.test.tsx?",
        "[test] unit --watch": "jest src/.*.unit.test.tsx? --watch",
        "[test] integration": "jest __tests__/.*.int.test.tsx? --silent",
        "[test] integration --watch": "jest __tests__/.*.int.test.tsx? --watch --silent",
        //...
    },

If I run yarn "[test] unit --watch" or npm run "[test] unit --watch" it works

But if I click on the play button near the script name in the left panel it calls yarn run [test] unit --watch, and throws a Command "[test]" not found.

Link to the SO question

Is this a vscode bug?

Activity

  1. added
    feature-request
    good first issue
    help wanted
    tasks
    on Jan 5, 2021
  2. added this to the Backlog milestone on Jan 5, 2021
  3. swapnilmisal commented on Jan 8, 2021

    @swapnilmisal

    Alex Ross (@alexr00) I would like to contribute to resolving this issue.

  4. alexr00 commented on Jan 11, 2021

    @alexr00
    Member

    Swapnil Misal (@swapnilmisal) thanks for the interest! However, there is already a PR that fixes this issue that is almost ready to merge: #113840

  5. swapnilmisal commented on Jan 11, 2021

    @swapnilmisal

    Alex Ross (@alexr00) yeah sure, I'll find some other issue to work on.

  6. added a commit that references this issue on Jan 18, 2021
    9441f1c
  7. added
    unreleased
    insiders-released
    and removed
    unreleased
    on Jan 18, 2021
  8. locked and limited conversation to collaborators on Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestgood first issuehelp wantedinsiders-releasedtasksverified

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions