resolving multiple tasks with type npm and same script fails
See original GitHub issueIssue Type: Bug
Create 2 tasks with “type”: “npm” and same “script”
Expected both tasks to be resolved by their label
- VsCode will list only one of those tasks when listing available tasks with “Tasks: Run Task”.
- Depending tasks will fail with “Couldn’t resolve dependent task ‘x’ in workspace folder ‘y’” in the “Tasks” output.
tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "start_both",
"type": "shell",
"dependsOn": [
"start_nr_1",
"start_nr_2"
],
"problemMatcher": []
},
{
"label": "start_nr_1",
"type": "npm",
"script": "start",
"problemMatcher": []
},
{
"label": "start_nr_2",
"type": "npm",
"script": "start",
"options": {
"env": {
"SOME": "option"
}
},
"problemMatcher": []
},
]
}
package.json:
{
"scripts": {
"start": "echo running 'start' script"
}
}
VS Code version: Code 1.43.1 (fe22a9645b44368865c0ba92e2fb881ff1afce94, 2020-03-18T07:01:20.184Z) OS version: Windows_NT x64 10.0.19041
System Info
Item | Value |
---|---|
CPUs | Intel® Core™ i7-4790 CPU @ 3.60GHz (8 x 3592) |
GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: disabled_off protected_video_decode: unavailable_off rasterization: enabled skia_renderer: disabled_off_ok video_decode: enabled viz_display_compositor: enabled_on viz_hit_test_surface_layer: disabled_off_ok webgl: enabled webgl2: enabled |
Load (avg) | undefined |
Memory (System) | 15.92GB (8.47GB free) |
Process Argv | |
Screen Reader | no |
VM | 0% |
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
How to solve npm install error “npm ERR! code 1”
When I try to run the npm install command in an older project, I faced the same issues and I resolved it by...
Read more >Common errors | npm Docs
Some strange issues can be resolved by simply running npm cache clean and trying again. If you are having trouble with npm install...
Read more >npm-run-all
A CLI tool to run multiple npm-scripts in parallel or sequential. ⤴️ Motivation. Simplify. The official npm run-script command cannot run ...
Read more >workerpool - npm
A worker executes one task at a time, and once finished, ... What this means is that all I/O code that you write...
Read more >npx - npm Docs
This command allows you to run an arbitrary command from an npm package (either one installed locally, or fetched remotely), in a similar...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Workaround: add a path property and use ‘.’, or ‘./.’ or ‘././.’ etc.
@alexr00 I just hit this today as well, in my situation both script calls had different working directories:
In my case I don’t really have ownership of the web/client and web/server package.json files, so renaming or adding script sections is not an option…