After 2 Years of Website development, i totally forgot how to use NextJS. It works before but when trying to build new one, got an error. Seems many changes happens. I’m trying to install nextJs latest version (current  version 13). and got this error.

kangartha@Kangs-MacBook-Pro-2 my-app % npm run dev

> [email protected] dev /Users/mymac/Sites/nextjs/my-app
> next dev

/Users/mymac/Sites/nextjs/my-app/node_modules/next/dist/compiled/undici/index.js:1
(()=>{var __webpack_modules__={1900:(A,e,t)=>{“use strict”;const{parseContentType:s}=t(4318);function getInstance(A){const e=A.headers;const t=s(e[“content-type”]);if(!t)throw new Error(“Malformed content type”);for(const s of o){const o=s.detect(t);if(!o)continue;const r={limits:A.limits,headers:e,conType:t,highWaterMark:undefined,fileHwm:undefined,defCharset:undefined,defParamCharset:undefined,preservePath:false};if(A.highWaterMark)r.hi ….

After 2 hours debuging, finally this only can be solved by updating NodeJs into Newest version Node-v18 , lol….

Download nodeJS here https://nodejs.org/en/download into you MAC and install it.

By doing those action should be working fine like below, my NextJS running now.

if you have mac and want to use brew, use those command;

brew install node@18
brew unlink node
brew link node@18

echo ‘export PATH=”/usr/local/opt/node@18/bin:$PATH”‘ >> ~/.bash_profile
source ~/.bash_profile

still not working? maybe the problem is on your .bash_profile , so you need to check what inside of it;

type this on your terminal nano ~/.bash_profile , remove all export PATH=”bla—bla–bla” and put this,
export PATH=”/usr/local/opt/node@18/bin:$PATH”

control+X (exit and save of your terminal editor) and type source ~/.bash_profile

Good Luck 🙂