'Module not found: Can't resolve 'regenerator-runtime' in next js 12.1.5 with react 18 with node 16

My package.json is like

   "scripts": {
    "dev": "next dev"
  },
  "dependencies": {
    "next": "^12.1.5",
    "react": "^18.0.0",
    "react-dom": "^18.0.0"
  }

After starting dev, I am getting the below error.

error - ./node_modules/next/dist/client/dev/amp-dev.js
Module not found: Can't resolve 'D:\mywebsites\next.jsudemy\next-blog\node_modules\next\dist\compiled\regenerator-runtime\runtime.js' in 'D:\mywebsites\next.js\udemy\next-blog\node_modules\next\dist\client\dev'


Solution 1:[1]

As I have same issues, I have downgraded [email protected] and [email protected]

Now seems working.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Benjamin Xu