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

> Fix the 'Module not found: Can't resolve encoding' error in Next.js, coming from node-fetch, by running npm install encoding to add the missing package.

Author: Flavio Copes | Published: 2023-04-18 | Canonical: https://flaviocopes.com/fix-module-not-found-cant-resolve-encoding-in-nextjs/

I ran into this error in a [Next.js](https://flaviocopes.com/nextjs/) 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!
