14
votes

i want to install neumorphism-react package

but i got this error

Module not found: Can't resolve '@emotion/react' in 'C:\Users\Asus\Desktop\react projects\visitor\node_modules@emotion\styled\base\dist'

here are the dependencies in 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"
4
Looks like you're needing the @emotion/react package, it's no in your dependency and obviously not being included in your dependencies' dependencies either - Jayce444

4 Answers

20
votes

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

npm install @emotion/react

or

yarn add @emotion/react
5
votes

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/[email protected]

with yarn

yarn add @emotion/[email protected]
2
votes

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

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

or

 yarn install @emotion/react
 yarn install @emotion/styled
1
votes

'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";