Closed igorkamyshev closed 3 years ago
whoa, gonna try to replicate and find out how to fix this issue
I try it in several repos with yarn2 and pnp linker and it reproduces every time 🤗
Hey! Thank you for the issue, was able to reproduce with yarn2
Thing is, yarn2 stores dependencies differently then npm or even yarn1, but in the package we rely on npm way of storing packages. node_modules/<package>
and not .yarn/unplugged/<package>
that's why it fails :(
I wasn't able to research this problem deep enough, but was able to create and release a stab. Could you check out @2.0.3 version? It fixed the problem for me :)
C:\Users\toplenboren\web\testy-thingy-project>yarn set version berry
Resolving berry to a url...
Downloading https://github.com/yarnpkg/berry/raw/master/packages/berry-cli/bin/berry.js...
Saving it into C:\Users\toplenboren\WebstormProjects\untitled\.yarn\releases\yarn-berry.cjs...
Updating C:\Users\toplenboren\WebstormProjects\untitled/.yarnrc.yml...
Done!
C:\Users\toplenboren\web\testy-thingy-project>yarn
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 1s 81ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ help@npm:3.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ simple-git-hooks@npm:2.0.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0031: │ One or more node_modules have been detected and will be removed. This operation may take some time.
➤ YN0007: │ simple-git-hooks@npm:2.0.3 must be built because it never did before or the last one failed
➤ YN0000: └ Completed in 0s 659ms
➤ YN0000: Done with warnings in 1s 897ms
C:\Users\toplenboren\web\testy-thingy-project>yarn dlx simple-git-hooks
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0007: │ simple-git-hooks@npm:2.0.3 must be built because it never did before or the last one failed
➤ YN0000: └ Completed in 0s 541ms
➤ YN0000: Done in 0s 612ms
[INFO] Successfully set the pre-push with command: exit 2
[INFO] Successfully set the pre-commit with command: exit 2
[INFO] Successfully set all git hooks
Also please note that I used
yarn dlx simple-git-hooks
to update the git hooks, instead ofnpx simple-git-hooks
Yes, this fix works correct. Thanks!
Hello! Thanks for the lib. I tried migrate from husky4 to this solution and found a problem.
When I try to install this lib:
I see in console the following message:
This is complete log:
I use yarn version 2.4.1.
Could you help me to find a solution, please?