未找到模块: 无法解析“@情绪/反应”

我想安装 反应软件包。

但我得到了这个错误

未找到模块: 无法解析“@情绪/反应” C: 华硕桌面用户的反应 项目访问者节点 _ 模块@情感风格的基础盘’

下面是 package.json中的依赖项

"@emotion/core": "^11.0.0",
"@emotion/styled": "^11.0.0",
"@testing-library/jest-dom": "^5.11.6",
"@testing-library/react": "^11.2.2",
"@testing-library/user-event": "^12.6.0",
"neumorphism-react": "^1.1.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "4.0.1",
"semantic-ui-react": "^2.0.1",
"web-vitals": "^0.2.4"
182291 次浏览

'yarn install' or 'node install' at the directory of package.json.

I'm looking at the docs, the package you're trying to use may not exist.

Make sure you are importing from the current library. For example:

import { NeuButton } from "neumorphism-react";

I had a similar issue and I resolved it by calling:

npm install @emotion/react

or

yarn add @emotion/react

if you use npm:

npm install  @emotion/react

if you use yarn:

yarn add @emotion/react

but in recent version they rename the package @emotion/core to @emotion/react, if you use other package that are depending on @emotion/core

  • that mean you need to hook up to source code and update import statement to the new @emotion/react

or downgrade package to older versions with npm

npm install @emotion/core@10.1.1

with yarn

yarn add @emotion/core@10.1.1

I had a similar issue and I resolved it by calling:

npm install @emotion/react
npm install @emotion/styled

or

 yarn add @emotion/react
yarn add @emotion/styled

Only this worked for me:

npm i @emotion/styled @emotion/core

I had a similar issue and I resolved it by calling:

for the npm:

npm install @emotion/react
npm install @emotion/styled

for the yarn:

yarn add @emotion/react
yarn add @emotion/styled

For specific version you can install like : @emotion/core@10.1.1 & @emotion/styled

in npm:

npm install @emotion/core@10.1.1
npm install @emotion/styled

in yarn:

yarn add @emotion/core@10.1.1
yarn add @emotion/styled

An all-stop solution...

npm install @mui/material @emotion/react @emotion/styled

None of these solutions worked for me. I resolved it by running:

npm install @emotion/server

I am using mui with nextjs.

Add below commands into package.json under Dependencies

"@emotion/core": "^11.0.0",
"@emotion/react": "^11.8.2",
"@emotion/styled": "^11.8.1",

Run npm install

I had all of the above and still was getting the error. I ended up deleting the yarn.lock & node_modules and the run yarn again

I had the same issue. I tried npm install @emotion/react but it didn't solve my problem because I already had the package installed.

I restarted VS Code and the linter was happy 😀

I had the same error and resolved it by running the below commands.

npm install @emotion/react
npm install @emotion/core
npm install @emotion/styled

These commands will install the emotion package to the dependencies of your project.

after this, make sure you restart your development server and your IDE if necessary. Your dev server won't pick up the changes until you stop it and re-run the npm start command.

also, install the @emotion/css package if you are using CSS as well.

If the error is still there then, try to delete your node_modules and package-lock.json file (not package.json) files, re-run npm install, and restart your IDE.

visit for more information: https://bobbyhadz.com/blog/react-module-not-found-cant-resolve-emotion-react

YOU NEED INSTALL : @emotion/react AND @emotion/styled WHILE @mui/material is installed and sometimes it look likes that it've finished but still no proggress, at these cases just w8 and it will finish depend on your connection speed

npm install @mui/material @emotion/react @emotion/styled

or

npm install @mui/material
npm install @emotion/react
npm install @emotion/styled

visit this for installation docs Installation MUI

For those who are using nextJS, try to delete the .next dir after installing the dependencies.