If project has yarn.lock file, vsce will use yarn automatically. However, when using --yarn flag, it will fall back to npm
I don't use yarn and I received the following error:
% vsce package
Executing prepublish script 'yarn run vscode:prepublish'...
/bin/sh: yarn: command not found
ERROR yarn failed with exit code 127
These are the only packages I have globally:
% npm -g list --depth 0
/usr/local/lib
├── [email protected]
├── [email protected]
└── [email protected]
In addition to @roydukkey comments. A fresh project with no .yarnrc, yarn.lock or yarn executable installed is defaulting to yarn.
Executing prepublish script 'npm run vscode:prepublish'...)Executing prepublish script 'yarn run vscode:prepublish'... and failing with 'yarn' is not recognized as an internal or external command,
operable program or batch file.
ERROR yarn failed with exit code 1
Does --no-yarn helps?
@felipecrs It did not, as I am using azure build pipeline. rather I am not sure what changes/task I need to change in azure pipeline. My extension scripts are
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"test": "npm run compile && node ./node_modules/vscode/bin/test"
},
I can confirm the bug, I tried to debug but I was not able to.
For users facing this issue, I recommend to downgrade vsce:
{
"devDependencies": {
"vsce": "1.80.0"
}
}
Okay, I found the issue.
The commander always sets the yarn option to true by default, rather than undefined.
/cc @rbuckton @joaomoreno
Submitted a PR. This behavior was fixed in commander 3.0.0.
adding --no-yarn fixed the issue, but I think every user need to update their pipeline for this is not a good recommendation.
adding
--no-yarnfixed the issue, but I think every user need to update their pipeline for this is not a good recommendation.
For sure, it's not a solution, just a workaround until the issue gets fixed.
However, I believe the best workaround so far is to downgrade the vsce to 1.80.0.
Oof, sorry about that. Releasing a new version asap.
Sorry for the breakage everyone. v1.81.1 is cooking right now with the fix and should be out in a few minutes.
Thank you very much. @felipecrs
Most helpful comment
I don't use yarn and I received the following error:
These are the only packages I have globally: