how to apply 'noindex' to all nodes and leave Alias indexable to prevent perceived duplicates for SEO
For Drupal8 and 9 what you need is simply this module: https://www.drupal.org/project/redirect. It will redirect all /node/* to its alias. For Drupal7: https://www.drupal.org/project/globalredirect