How to hide a form field in hook_node_view() function hook_node_view($node, $view_mode, $langcode) {
// How can I hide a field in the hook_node_view() using $node
// In my case the field is an image file field
}
You can't. hook_node_view() exists only to


  Act on a node that is being assembled before rendering.


It can't be used to alter the node's edit form.

You need to use hook_form_alter() or hook_form_FORM_ID_alter(), to alter form elements e.g.

function MYMODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'article_node_form' &amp;&amp; $some_other_condition) {
    $form['some_element']['#access'] = FALSE;
  }
}