Skip to content

[docs] Codemod breaks upon missing modules #45981

@RobbieS82

Description

@RobbieS82

Related page

https://mui.com/material-ui/migration/migration-v4/

Kind of issue

Other

Issue description

When I run the codemod Run the migrator: npx @mui/codemod@latest v5.0.0/preset-safe . I am met with the following error:

Error: Cannot find module '@material-ui/core/es/colors'
Require stack:
- C:\Users\613296\AppData\Local\npm-cache\_npx\2aacf93ee2439f59\node_modules\@mui\codemod\v5.0.0\optimal-imports.js
- C:\Users\613296\AppData\Local\npm-cache\_npx\2aacf93ee2439f59\node_modules\@mui\codemod\v5.0.0\preset-safe.js

I verified the two javascript files (optimal-imports.js and preset-safe.js) are present.
Not sure if this means the conversion failed or if the codemod worked.

Context

I inherited a react webapp at work, and it is outdated. I'm trying to get it to install and build, but the @material-ui libraries were causing a lot of trouble. So I am trying to upgrade them.

Search keywords: cannot find module optimal-imports preset-safe

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions