
Couldn't find the binary.. after run npm clean, and if i run with npm run dev it still can not
@adnanfajlur Did you find a solution for this? I'm getting the same error.

use ubuntu bash on windows,
i think the problem is in path
Thanks @adnanfajlur. you are right it was a issue with cmd. So I check with git bash and now I'm getting a different error.
/d: /d: Is a directory
I think it is also related to problem with the path.
This isn't working because an empty array [] is passed into the spawn() function for the arguments parameter i.e.
yarn/src/util/execute-lifecycle-script.js
const stdout = await child.spawn(cmd, [], {cwd, env, stdio, detached, shell}, onProgress);
I'm not sure why that array is empty. Are the arguments supposed to be passed another way?
I have the same issue when running a simple npm script
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"copy": "cpx \"src/products/**.*\" dist/products --verbose"
}
Yarn
error Couldn't find the binary cpx
Npm
Exact same issue from ... yeasterday all was fine, today I can't run scripts with yarn. NPM is working just fine.
I'm o a Windows 10 x64 machine.
What should we change to the Path?
I have this problem is well.
On windows I have set a custom shell (git bash) with yarn config set and npm config set
NPM works, but yarn does not.

I suspect it has to do with the space in "Program Files". Let me know if you need more details.
Hi All, I got a fix for my error in another issue https://github.com/yarnpkg/yarn/issues/6086#issuecomment-423361321
Please have a look at this reply and see if it helps you with your problem.
Thank you so much for the link @shabith ... works again
In short ... open your ~.npmrc file and remove the line
shell-script=bash
The only weird thing is it was working just fine one day and the other day we got stuck with yarn not running any command, without updating yarn nor node
Could a windows update be the problem to this?
I don't think it is related to windows update @richardsengers. But it could be related to node update. Anyway I'm glad it is working again.
I had the same issue. In my case I removed yarn.lock then I tested again and it worked!. You may have a try deleting yarn.lock. Maybe yarn requires git in certain dependencies declared in yarn.lock
I'm not able to fix it :/ I've tried deleting my yarn lock files, that didnt work.. I also tried removing the shell-script=bash in my .npmrc file but that wasnt even there.
Is this problem still relevant?
Most helpful comment
Hi All, I got a fix for my error in another issue https://github.com/yarnpkg/yarn/issues/6086#issuecomment-423361321
Please have a look at this reply and see if it helps you with your problem.