Execute the following query in MYSQL Workbench
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'
Where root as your userlocalhost as your URL
and password as your password
Try connecting using node after you do so
This is because caching_sha2_password is introduced in MySQL 8.0, but the Node.js version is not implemented yet.
Copy from Stack Overflow