Search code examples
typescriptnext.jsframer-motion

Getting Error: EINVAL errno: -4071 in NextJS, unable to fix


I'm working on a nextjs project and today I've been unable to start the project (using npm run dev). I've been getting the following error:

[Error: EINVAL: invalid argument, readlink 'C:\Users\cxXni\OneDrive\Documents\AA-DEV\ctsolutions\frontend\.next\server\vendor-chunks\framer-motion.js'] {
  errno: -4071,
  code: 'EINVAL',
  syscall: 'readlink',
  path: 'C:\\Users\\cxXni\\OneDrive\\Documents\\AA-DEV\\ctsolutions\\frontend\\.next\\server\\vendor-chunks\\framer-motion.js'
}

I've tried restarting my PC, deleting node_modules and running npm i, removing a couple packages that I recently added, even removing the last component I added to my app, all top no avail. I'm currently stuck unable to run my project, and googling my error hasn't helped one bit. I'm clueless as to what the error is and how to go about fixing it. Here are my dependencies if that is of any help:

"dependencies": {
    "@radix-ui/react-dropdown-menu": "^2.0.6",
    "@radix-ui/react-icons": "^1.3.0",
    "@radix-ui/react-navigation-menu": "^1.1.4",
    "@radix-ui/react-select": "^2.0.0",
    "@radix-ui/react-slot": "^1.0.2",
    "class-variance-authority": "^0.7.0",
    "clsx": "^2.1.0",
    "framer-motion": "^11.1.7",
    "i18next": "^23.11.2",
    "i18next-resources-to-backend": "^1.2.1",
    "next": "^14.2.2",
    "next-i18n-router": "^5.4.0",
    "next-themes": "^0.3.0",
    "react": "^18",
    "react-dom": "^18",
    "react-i18next": "^14.1.0",
    "tailwind-merge": "^2.2.2",
    "tailwindcss-animate": "^1.0.7"
  },
  "devDependencies": {
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "eslint": "^8",
    "eslint-config-next": "14.2.1",
    "postcss": "^8",
    "prettier": "^3.2.5",
    "prettier-plugin-tailwindcss": "^0.5.14",
    "tailwindcss": "^3.4.1",
    "typescript": "^5"
  }

I'm using node v20.12.2 and npm v10.5.2, that hasn't changed since last time I was able to run my project.


Solution

  • Welp after a while of fiddling with stuff i deleted the .next directory and run npm run dev and it fixed the issue......