4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Cannot find module '@emotion/styled' from 'node_modules/@material-ui/styled-engine/node/index.js'のエラーの解決策

Last updated at Posted at 2021-06-13

#@emotion/styledのError
以下のようなErrorが出たので解決策をメモがわりに記載します。

Cannot find module '@emotion/styled' from 'node_modules/@material-ui/styled-engine/node/index.js'

##解決策

npm install @emotion/react @emotion/styled

yarnを入れている人なら

yarn add @emotion/react @emotion/styled

該当部のpackage.jsonは以下になります。

  "peerDependencies": {
    "@emotion/react": "^11.0.0",
    "@emotion/styled": "^11.0.0",
    "react": "^17.0.0"
  },

多分、受講でこのようなErrorは指定のバージョンでやれば出ないと思いますが、
私は最新版のバージョンでやろうとしたため出たものだと思われます。

Module not found: Can't resolve '@emotion/react'

のErrorであれば
以下のstack overflowさんの記事が参考になると思います。
https://stackoverflow.com/questions/65486256/module-not-found-cant-resolve-emotion-react

4
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?