I am trying to access a node programmatically and getting errors though using (AFAIK) the recommended way.
My code (so far) is really simple.
use Drupal\node\Entity\Node; $nid=1805; $node = Node::load($nid); print_r($node, true);
It keeps failing with this error message.
[09-Nov-2020 08:32:31 UTC] PHP Fatal error: Uncaught Error: Class 'Drupal\node\Entity\Node' not found in test-node-access.php
The program resides (at least currently) in Drupal root directory. I am acting on user action via AJAX call from a paragraph (as a lame explanation to a little un-orthodox implementation).