Late to the game here but we struggled forever on one minor point.
make sure that tasks.json is spelled correctly, not task.json
In launch.json, the preLaunchTask looks for the script in tasks.json with a "label" of that name. If file tasks.json is really named task.json then then message is can't find the script, instead of can't find the file tasks.json.