npm install next@canary --legacy-peer-deps npm i --force
Use this command for installing canary version of next js , as it will update all the version of your previously used dependency
NOTE : This is not recommended for production !