I solved the problem by myself.
Follow the tutorials: Build a Shopify App with Node.js and React
After I run "npm run dev", Then use the merchant install link. It finally works.
This actually worked for me too, except for this part
"Stop your server from the terminal window that’s running Next.js (ctrl + c).".
Don't stop your ngrok, and if you do, change the "App URL" and "Whitelisted redirect URLs" in the app settings.
After days of investigation and tests I found a workaround for this problem.
1. Navigate to the 'Custom App Merchant Link' in a chrome session (autenticate in the shopify store if necessary) Ignore the result...
2. Now, in the same chrome session navigate to the autentication url. Accept the installation:
Hope this helps someone.