mysticatea / npm-run-all

A CLI tool to run multiple npm-scripts in parallel or sequential.
MIT License
5.72k stars 240 forks source link

Task not found #239

Open joeprivettsmart opened 2 years ago

joeprivettsmart commented 2 years ago

I am running this command in my Mac terminal:

joe.bloggs$ yarn run start

but I get the output:

yarn run v1.22.15 $ npm-run-all -s "yarn start:backend" "yarn start:frontend" ERROR: Task not found: "yarn"

Clearly I have yarn installed otherwise it wouldn't be able to run yarn run start, so why does npm-run-all not find the yarn command?

ArtskydJ commented 1 year ago

npm-run-all is for running npm scripts, not arbitrary shell commands.

You might need to change your package.json file like this:

{
    // ...
    "scripts": {
-       "start": "npm-run-all -s \"yarn start:backend\" \"yarn start:frontend\"",
+       "start": "npm-run-all -s start:backend start:frontend",
        "start:backend": "...",
        "start:frontend": "...",
        // ...
    }
}

If you need to run them using yarn for whatever reason, then npm-run-all isn't the right tool for the job.