Access nid in field template How do I access the nid of the current node in a field.html.twig template?
I found myself a solution for this. Maybe not the perfect way to go, but it worked very well for my needs:

in .theme-file:

function MYTHEME_preprocess_field(&amp;$variables, $hook) {
   $variables['nodenid'] = \Drupal::routeMatch()-&gt;getRawParameter('node');
}


and in .twig:

{{ nodenid }}


of course you might want to filter the preprocess hook to only add this variable to a specific field.