Open
Description
Self-service
- I'd be willing to implement a fix
Describe the bug
When:
- use
yarn
command to install a dependence package from Git Source; - there are no build scripts in the git package;
- there is a dev dependence package whose descriptor is
"workspace:*"
, and it's not hosted in the repository of the git package.
what happens:
yarn
failed with YN0058.
YN0058: │ git-source-package@git+ssh://[email protected]:AmyFoxFN/yarn-demo-git-source-package.git#commit=b367f12603cbc45eb3db49d44d6363e928f6b6d5: Packing the package failed (exit code 1, logs can be found here: /private/var/folders/vk/jl551z8j4157nvxvv9wj1sqr0000gn/T/xfs-a1cb5754/pack.log)
- errors in pack.log.
ct [Error]: local-workspace@workspace:*: No local workspace found for this range
at xVe (/Users/didi/.node/corepack/yarn/3.2.0/yarn.js:712:37482)
at Xa.triggerHook (/Users/didi/.node/corepack/yarn/3.2.0/yarn.js:396:3373)
at Yue (/Users/didi/.node/corepack/yarn/3.2.0/yarn.js:712:30939)
at /Users/didi/.node/corepack/yarn/3.2.0/yarn.js:712:30487 {
reportExtra: undefined,
reportCode: 21
}
To reproduce
await expect(packageJsonAndInstall({
dependencies: {
[`git-source-package`]: `git+ssh://[email protected]:AmyFoxFN/yarn-demo-git-source-package.git#b367f12603cbc45eb3db49d44d6363e928f6b6d5`,
}
})).resolves.toBeTruthy()
It seems the default sherlock reproduction env could not install packages by git+ssh. You may need to use my own demo to reproduce:
Environment
System:
OS: macOS 12.6
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Binaries:
Node: 16.17.0 - /private/var/folders/vk/jl551z8j4157nvxvv9wj1sqr0000gn/T/xfs-75b5a995/node
Yarn: 3.3.0 - /private/var/folders/vk/jl551z8j4157nvxvv9wj1sqr0000gn/T/xfs-75b5a995/yarn
npm: 8.15.0 - /usr/local/bin/npm
Additional context
Related issue #1915