Framer motion error: Module not found: Can't resolve 'react'

I just started a new next.js project and I am trying to use framer motion inside it and on importing motion from framer-motion I get the errror below

Module not found: Can't resolve 'react'

here is my import statement

import { motion } from 'framer-motion'


message profile

This error occurs because React is not installed in your project. To confirm check if react and react-dom are part of your package.json. 

If they are not there then add it like this and run npm install again

  "dependencies": {
    "framer-motion": "^10.12.16",
    "react": "18.2.0",
    "react-dom": "18.2.0"


Add Message

Click on the button below to add a new message to this thread


#Javascript #next js

Thread detail

Satus: Open
Messages: 1Started: 2023-06-05




Frontend Development |Backend Development |Full Website Development |Bootstrap Website upgrades | Website Debbugging | Website Hosting & deployment


Interested in hiring me or collaborating with me on a project, click on any of the links below to get my social media handle

Or contact me via Tel: (+234)-806-225-7480 | Email:
Privacy Policy

By using our website,
you agree that devmaesters can store cookies on your device and disclose information in accordance with our privacy policy.