Cannot find module '@material-ui/core/es' error when running material-ui codemod

Viewed 448

I'm trying to run the top-level-imports codemod found here: https://github.com/mui-org/material-ui/blob/master/packages/material-ui-codemod/README.md#top-level-imports.

So I ran npm install -D @material-ui/codemod and then I ran the script find src -name '*.tsx' -print | xargs npx jscodeshift -t node_modules/@material-ui/codemod/lib/v4.0.0/top-level-imports.js and I get the following error output:

Processing 1 files... 
Spawning 1 workers...
Sending 1 files to free worker...
 ERR ./components/form/TextField.tsx Transformation error (Cannot find module '@material-ui/core/es')
Error: Cannot find module '@material-ui/core/es'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.resolve (internal/module.js:18:19)
    at transformer (.../node_modules/@material-ui/codemod/lib/v4.0.0/top-level-imports.js:29:54)
All done. 

Has anyone encountered this before?

0 Answers
Related