Skip to content

react-codemod + yarn berry issues #2997

Answered by merceyz
wdfinch asked this question in Q&A
Discussion options

You must be logged in to vote

It's an issue with how they try to locate the binary for jscodeshift (https://github.com/reactjs/react-codemod/blob/b34b92a1f0b8ad333efe5effb50d17d46d66588b/bin/cli.js#L20), Yarn in PnP mode will never produce that file so even if we allowed undeclared requires for dotfiles (.bin, .cache et al) it will never get a match.

With that out of the way here is a patch you can apply to fix it using https://yarnpkg.com/features/protocols/#patch

diff --git a/bin/cli.js b/bin/cli.js
index 6640b376d7f449e8551eb970cadf267784224adb..b34fc4117952c01b7d630fbc3053fa73c855be9f 100644
--- a/bin/cli.js
+++ b/bin/cli.js
@@ -17,7 +17,7 @@ const chalk = require('chalk');
 const isGitClean = require('is-git-clea…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@merceyz
Comment options

merceyz Jun 7, 2021
Collaborator

@wdfinch
Comment options

Answer selected by wdfinch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants