Fails to install on Yarn 3
alvarlagerlof opened this issue ยท 13 comments
๐ Bug Report
Current react spring does not install on Yarn 3.1.0 on a minimal project
To Reproduce
- npm install -g yarn
- Create a empty directory
- yarn set version berry
- yarn add react-spring
Expected behavior
React spring installs without issues.
Link to repro (highly encouraged)
Needs CLI
Environment
react-spring
v9.3.0
Thanks for the report! this is a duplicate of #1668
@joshuaellis I don't believe it is. Sorry for not providing CLI output before. This one seems more related to react-spring.
โค YN0000: โ Resolution step
โค YN0002: โ react-spring@npm:9.3.0 doesn't provide @react-three/fiber (pb91c8), requested by @react-spring/three
โค YN0002: โ react-spring@npm:9.3.0 doesn't provide konva (pe619c), requested by @react-spring/konva
โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react (pac595), requested by @react-spring/core
โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react (pf7cd9), requested by @react-spring/konva
โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react (pda097), requested by @react-spring/native
โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react (pe6c53), requested by @react-spring/three
โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react (p3668a), requested by @react-spring/web
โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react (p44ae1), requested by @react-spring/zdog
โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react-dom (pea721), requested by @react-spring/web
โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react-dom (pe22c1), requested by @react-spring/zdog
โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react-konva (pbdfb4), requested by @react-spring/konva
โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react-native (p3eb33), requested by @react-spring/native
โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react-zdog (p22cb6), requested by @react-spring/zdog
โค YN0002: โ react-spring@npm:9.3.0 doesn't provide three (pf3bcb), requested by @react-spring/three
โค YN0002: โ react-spring@npm:9.3.0 doesn't provide zdog (p1f667), requested by @react-spring/zdog
โค YN0000: โ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
โค YN0000: โ Completed
โค YN0000: โ Fetch step
โค YN0000: โ Completed
โค YN0000: โ Link step
โค YN0007: โ @react-spring/core@npm:9.3.0 [cd765] must be built because it never has been before or the last one failed
โค YN0009: โ @react-spring/core@npm:9.3.0 [cd765] couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-72db173b/build.log)
โค YN0000: โ Completed in 0s 245ms
โค YN0000: Failed with errors in 0s 345ms
@joshuaellis I don't believe it is. Sorry for not providing CLI output before. This one seems more related to react-spring.
โค YN0000: โ Resolution step โค YN0002: โ react-spring@npm:9.3.0 doesn't provide @react-three/fiber (pb91c8), requested by @react-spring/three โค YN0002: โ react-spring@npm:9.3.0 doesn't provide konva (pe619c), requested by @react-spring/konva โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react (pac595), requested by @react-spring/core โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react (pf7cd9), requested by @react-spring/konva โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react (pda097), requested by @react-spring/native โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react (pe6c53), requested by @react-spring/three โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react (p3668a), requested by @react-spring/web โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react (p44ae1), requested by @react-spring/zdog โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react-dom (pea721), requested by @react-spring/web โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react-dom (pe22c1), requested by @react-spring/zdog โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react-konva (pbdfb4), requested by @react-spring/konva โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react-native (p3eb33), requested by @react-spring/native โค YN0002: โ react-spring@npm:9.3.0 doesn't provide react-zdog (p22cb6), requested by @react-spring/zdog โค YN0002: โ react-spring@npm:9.3.0 doesn't provide three (pf3bcb), requested by @react-spring/three โค YN0002: โ react-spring@npm:9.3.0 doesn't provide zdog (p1f667), requested by @react-spring/zdog โค YN0000: โ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code โค YN0000: โ Completed โค YN0000: โ Fetch step โค YN0000: โ Completed โค YN0000: โ Link step โค YN0007: โ @react-spring/core@npm:9.3.0 [cd765] must be built because it never has been before or the last one failed โค YN0009: โ @react-spring/core@npm:9.3.0 [cd765] couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-72db173b/build.log) โค YN0000: โ Completed in 0s 245ms โค YN0000: Failed with errors in 0s 345ms
You can cat /tmp/xfs-72db173b/build.log
to see if it's the same error, but I think it is, I'm having the same.
Gonna be honest, i'm still using yarn 1.X why? because I've always found yarn's error messages to be cryptic and it never just works. However, can I ask if you've:
- tried to just install a particular target i.e
@react-spring/web
- asked in the yarn repo? Feels weird I can install it with other package managers and have no issues.
As you mentioned, this is an issue in yarn v3:
An existing fix is to skip the build of @react-spring/core
as shown here:
I think that error report from yarn would help me understand if this is a duplicate or a different issue
You can cat /tmp/xfs-72db173b/build.log to see if it's the same error, but I think it is, I'm having the `same.
Right, I see now that it is the same error. Sorry for not realizing that.
# This file contains the result of Yarn building a package (@react-spring/core@virtual:cd7650f55e82fb441490c229ae2e73dde3c2a0e29ca9735f6a3a202375f9c134ab1778ff954307c5c379dc519bd09b5a2ccc8cd7f3964b712fac8baf9897ff04#npm:9.3.0)
# Script name: postinstall
[eval]:1
console.log('Enjoy react-spring? You can now donate to our open collective:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Invalid or unexpected token
at new Script (node:vm:100:7)
at createScript (node:vm:257:10)
at Object.runInThisContext (node:vm:305:10)
at node:internal/process/execution:81:19
at [eval]-wrapper:6:22
at evalScript (node:internal/process/execution:80:60)
at node:internal/main/eval_string:27:3
tried to just install a particular target i.e @react-spring/web
I did try that now, and it seems to fail too.
โฏ yarn add @react-spring/web
โค YN0000: โ Resolution step
โค YN0002: โ root-workspace-0b6124@workspace:. doesn't provide react (p22964), requested by @react-spring/web
โค YN0002: โ root-workspace-0b6124@workspace:. doesn't provide react-dom (p97098), requested by @react-spring/web
โค YN0000: โ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
โค YN0000: โ Completed in 3s 574ms
โค YN0000: โ Fetch step
โค YN0013: โ @react-spring/core@npm:9.3.0 can't be found in the cache and will be fetched from the remote registry
โค YN0013: โ @react-spring/rafz@npm:9.3.0 can't be found in the cache and will be fetched from the remote registry
โค YN0013: โ @react-spring/shared@npm:9.3.0 can't be found in the cache and will be fetched from the remote registry
โค YN0013: โ @react-spring/types@npm:9.3.0 can't be found in the cache and will be fetched from the remote registry
โค YN0013: โ @react-spring/web@npm:9.3.0 can't be found in the cache and will be fetched from the remote registry
โค YN0000: โ Completed
โค YN0000: โ Link step
โค YN0007: โ @react-spring/core@npm:9.3.0 [40ba1] must be built because it never has been before or the last one failed
โค YN0009: โ @react-spring/core@npm:9.3.0 [40ba1] couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-4b2129c8/build.log)
โค YN0000: โ Completed in 0s 305ms
โค YN0000: Failed with errors in 3s 983ms
This did work
An existing fix is to skip the build of
@react-spring/core
as shown here:
Why was this issue closed? It's still broken in 9.3.0
.
@shadowbrush yarnpkg/berry#1356 is the real issue so better to comment there.
We have a pretty big, complex mono-repo, and this is the only package that is tickling this bug. I get that yarn is the proper place to fix this, but isn't it relatively simple to fix this within react-spring? I wasted quite a bit of time on this.
It was fixed in 9.3.1
Looks like e10f785#diff-0b810c38f3c138a3d5e44854edefd5eb966617ca84e62f06511f60acc40546c7 fixed it, thank you.