A code I borrowed online doesn't work on my site!

Hello, I have been trying to get the current user info (such as paidPlans, roles and so on) and put it in a text but whatever code I try it just doesn’t work! It would not even log any info when i try the following:

import wixUsers from ‘wix-users’;

$w.onReady( function () {
//TODO: write your page related code here…
wixUsers.currentUser.getEmail()
.then( (email) => {
console.log(email); // “user@something.com
} );
});

Please help me! Thanks in advance…