Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasks: npm script aren't being prefixed with "run" #45709

Closed
bruno-brant opened this issue Mar 13, 2018 · 2 comments
Closed

Tasks: npm script aren't being prefixed with "run" #45709

bruno-brant opened this issue Mar 13, 2018 · 2 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) tasks Task system issues

Comments

@bruno-brant
Copy link
Contributor

bruno-brant commented Mar 13, 2018

  • VSCode Version: 1.22.0-insider 1126701 x64
  • OS Version: Microsoft Windows [Version 10.0.17074.1002]

Steps to Reproduce:

  1. Setup a task in tasks.json for "npm", with script as "build".
  2. Run the task by calling npm: run build in the command bar.

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

Example task.json:

{
	// See https://go.microsoft.com/fwlink/?LinkId=733558
	// for the documentation about the tasks.json format
	"version": "2.0.0",
	"tasks": [
		{
			"type": "npm",
			"script": "build",
			"group": {
				"kind": "build",
				"isDefault": true
			}
		}
	]
}

Task.json that works:

{
	// See https://go.microsoft.com/fwlink/?LinkId=733558
	// for the documentation about the tasks.json format
	"version": "2.0.0",
	"tasks": [
		{
			"type": "npm",
			"script": "run build", // <--- must add run!
			"group": {
				"kind": "build",
				"isDefault": true
			}
		}
	]
}

If this is expected behavior, it changed from last version. I think that the key "script" may lead a user (such as myself) to believe that a npm run-script will called, as opposed to any npm command (as it is right now).

Also, if that's expected behavior, task generation for npm is generating it wrong (exactly like my first example).

@vscodebot vscodebot bot added the tasks Task system issues label Mar 13, 2018
@bruno-brant
Copy link
Contributor Author

bruno-brant commented Mar 13, 2018

I think my diagnose may be wrong. What is happening is that nothing is being ran.

I thought the reason was that vscode was shelling "npm build" instead of "npm run build".

image

As you can see from the image, nothing is ran. Typing npm run build in the command line (inside vscode) successfully builds the application.

@dbaeumer
Copy link
Member

This is a duplicate of #45684. I broke that yesterday but is fixed in todays insider again. We added support for space quoting and I wrongly quoted whole command lines hence making them fail.

@dbaeumer dbaeumer added the *duplicate Issue identified as a duplicate of another issue(s) label Mar 14, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) tasks Task system issues
Projects
None yet
Development

No branches or pull requests

2 participants