react icon indicating copy to clipboard operation
react copied to clipboard

[React 19] codemod fails when ~/.codemod does not exist

Open aslilac opened this issue 1 year ago • 4 comments

Summary

When running npx codemod@latest react/19/migration-recipe I get an error like...

Error: ENOENT: no such file or directory, scandir '/home/xxxx/.codemod'
    at async readdir (node:internal/fs/promises:948:18)
    at async Object.findCredentials (/home/xxxx/.npm/_npx/bef22f83919465d9/node_modules/codemod/dist/index.cjs:32395:12105)
    at async CYn (/home/xxxx/.npm/_npx/bef22f83919465d9/node_modules/codemod/dist/index.cjs:32395:12501)
    at async DYn.get (/home/xxxx/.npm/_npx/bef22f83919465d9/node_modules/codemod/dist/index.cjs:32405:302)
    at async Mne (/home/xxxx/.npm/_npx/bef22f83919465d9/node_modules/codemod/dist/index.cjs:32405:1787)
    at async QCi (/home/xxxx/.npm/_npx/bef22f83919465d9/node_modules/codemod/dist/index.cjs:52988:1393)
    at async R2e (/home/xxxx/.npm/_npx/bef22f83919465d9/node_modules/codemod/dist/index.cjs:52990:377)
    at async Object.handler (/home/xxxx/.npm/_npx/bef22f83919465d9/node_modules/codemod/dist/index.cjs:52990:1075) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/home/xxxx/.codemod'
}

If I run mkdir ~/.codemod and then run the command again, it works normally.

aslilac avatar Dec 05 '24 22:12 aslilac

Thank you for reporting. I forwarded this to the folks maintaining the codemod CLI.

eps1lon avatar Dec 05 '24 23:12 eps1lon

thanks for flagging. on it.

alexbit-codemod avatar Dec 05 '24 23:12 alexbit-codemod

i cannot reproduce. which OS do you use @aslilac? im testing it on mac.

alexbit-codemod avatar Dec 06 '24 00:12 alexbit-codemod

My work development environment is a bit unconventional because we make (and dogfood) cloud development environment software. 😅

But it's...

  • Ubuntu 22.04
  • Running in a Docker container
  • Using sysbox-runc as the Docker runtime
  • ...and the home directory is mounted as a Docker volume (but my user has full read-write permissions)

aslilac avatar Dec 06 '24 00:12 aslilac

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

github-actions[bot] avatar Mar 06 '25 01:03 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

github-actions[bot] avatar Mar 13 '25 01:03 github-actions[bot]