[Bug] Can't install dependencies from git containing incompatible devDependencies
envgap__yarnpkg__berry-1915
Original GitHub issue ↗Opened 2020-10-02
01 / FAILURE SIGNATURE
As reported upstream
Error: `Packing the package failed`
Not a benchmark task.
- No curated issue-specific recipe or verified environment fix is available.
02 / ENVIRONMENT RECIPE
- Base commit
Not freshly verified- Manifest
package.json- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
yarnpkg/berry #1915 · read the original issue
- [x] I'd be willing to implement a fix
**Describe the bug**
`yarn install` fails on trying to install dependencies from git repositories in the pack step, seemingly related to when they contain ~optional modules~ **devDependencies (edited)** such as `node-sass` that fail to build (for whatever reason), after which yarn exits. This wasn't a problem with yarn v1.
Error: `Packing the package failed`
**To Reproduce**
Sample `package.json`:
```json
{
"dependencies": {
"react-tether": "https://github.com/marvelapp/react-tether.git"
}
}
```
Yarn v1 (success):
```
> yarn
yarn install v1.22.4
warning package.json: No license field
info No lockfile found.
warning No license field
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
warning " > react-tether@0.6.0" has unmet peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
warning " > react-tether@0.6.0" has unmet peer dependency "react-dom@^0.14.0 || ^15.0.0 || ^16.0.0".
[4/4] 🔨 Building fresh packages...
success Saved lockfile.
✨ Done in 4.18s.
```
Yarn v2 (fail):
```
> yarn
➤ YN0000: ┌ Resolution step
➤ YN0013: │ react-tether@https://github.com/marvelapp/react-tether.git#commit=b076c38b5c6bf752076109ab0d85876f80133f7b can't be found in the cache and will be fetched from GitHub
➤ YN0013: │ react-tether@https://github.com/marvelapp/react-tether.git#commit=b076c38b5c6bf752076109ab0d85876f80133f7b can't be found in the cache and will be fetched from the remote repository
➤ YN0058: │ react-tether@https://github.com/marvelapp/react-tether.git#commit=b076c38b5c6bf752076109ab0d85876f80133f7b: Packing the package failed (exit code 1, logs can be found here: /private/var/folders/d_/j4z429zn06g6fnvmxrh3xhy00000gn/T/xfs-003e7fc2/pack.log)
➤ YN0000: └ Completed in 22s 832ms
➤ YN0000: Failed with errors in 22s 836ms
```
<details>
<summary>react-tether's pack.log</summary>
```
Installing the project using Yarn Classic
➤ YN0000: Downloading https://nightly.yarnpkg.com/latest.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-1.23.0-20200928.1349.cjs
➤ YN0000: Done in 0s 571ms
yarn install v1.23.0-20200928.1349
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > react-motion-ui-pack@0.10.3" has incorrect peer dependency "react@0.14.x || ^15.0.0".
warning " > react-motion-ui-pack@0.10.3" has incorrect peer dependency "react-dom@0.14.x || ^15.0.0".
[4/4] Building fresh packages...
error /private/var/folders/d_/j4z429zn06g6fnvmxrh3xhy00000gn/T/xfs-2bf5a256/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: 04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]
Issue-specific recipe and runtime smoke command require review against the complete issue and repository.
Legacy reproduction is generic install-only; match the actual issue failure before admission.