Fix “Module not found: Can't resolve encoding” in Next.js

🆕 🔜 Check this out if you dream of running a solo Internet business 🏖️

I ran into this error in a Next.js application:

Module not found: Can’t resolve ‘encoding’ in …/node_modules/node-fetch/lib’

To fix this, I ran npm install encoding and the error was gone!