Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

react-codemod missing when installing with yarn #4

Closed
pruett opened this issue Mar 15, 2017 · 7 comments · Fixed by #14
Closed

react-codemod missing when installing with yarn #4

pruett opened this issue Mar 15, 2017 · 7 comments · Fixed by #14
Labels

Comments

@pruett
Copy link
Contributor

pruett commented Mar 15, 2017

I receive the following after using depercolate [--options]

ERROR Transform file /Users/pruett/.config/yarn/global/node_modules/depercolator/node_modules/react-codemod/transforms/create-element-to-jsx.js does not exist

Looking inside the depercolator folder (~/.config/yarn/global/node_modules/depercolator/node_modules), I do see a .bin directory housing a few symlinks (i.e. decaffeinate, jscodeshit, etc.) but not a react-codemod directory.

I did try and run the transform separately (with jscodeshift) and it got skipped anyway, so not sure it's even useful in my situation but was curious if it's reproducible on your end.

@foxyblocks
Copy link
Contributor

hmm, that is strange. It seems like it may be some issue with the yarn install or possibly your yarn setup.

Does it work when you install it with npm?

npm i -g depercolator

@foxyblocks
Copy link
Contributor

Also, what version of yarn do you have and what method did you use to install it?

@clschnei
Copy link

I had the same issue. Had to cd into the module directory to npm install to ensurereact-codemod, and it went without a hitch.

@pruett
Copy link
Contributor Author

pruett commented Mar 16, 2017

for what it's worth, installing via npm -g seemed to rectify this issue. it does seem to be yarn-related. the react-codemod still gets skipped which is annoying, but not related to depercolator.

Feel free to close issue as it seems doing a global npm install resolves this

@clschnei
Copy link

@pruett Curious why skipping the codemod wouldn't be related to depercolator? I feel like its pretty big part of the transform process to convert createElement() --> <jsx />.

@pruett
Copy link
Contributor Author

pruett commented Mar 17, 2017

@clschnei Apologies for not being clear. I meant to say that the specific transform create-element-to-jsx.js runs with depercolator, but the script outputs a Skipped status. So it's something I need to bring up with the react-codemod folks to figure out.

@foxyblocks foxyblocks changed the title Cannot find react codemod react-codemod missing when installing with yarn Apr 14, 2017
@foxyblocks foxyblocks added the bug label Apr 14, 2017
@foxyblocks
Copy link
Contributor

Another solution here could be to switch from react-codemod to the babel transform https://www.npmjs.com/package/babel-plugin-transform-react-createelement-to-jsx

I original didn't go with it because it had issues with rendering everything to one line, but that was before prettier came a long and solved that problem.

I'll look into this 🔜

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants