Hello,

I want to create a node programmatically but it's not working with this code :

$autoloader = require_once 'autoload.php';

					  $kernel = new DrupalKernel('prod', $autoloader);

					  $request = Request::createFromGlobals();
					  $response = $kernel->handle($request);
					  $response->send();
					
					$caracteristiques = $bdd3->prepare("SELECT node.type, node__body.langcode, title, body_value, body_format FROM node, node__body, node_field_data WHERE node.nid=node__body.entity_id AND node_field_data.nid=node.nid ");
					$carac = $caracteristiques->fetchAll();

					  $node = Node::create([
					  'type' => $carac['node.type'],
					  'langcode' => $carac['node__body.langcode'],
					  'created' => REQUEST_TIME,
					  'changed' => REQUEST_TIME,
					  'uid' => 1,
					  'title' => $carac['title'],
					  'body' => [
					    'summary' => '',
					    'value' => $carac['body_value'],
					    'format' => $carac['body_format'],
					  ],
								]);
					  $node->save();

Drupal\Core\Entity\EntityStorageException: Missing bundle for entity type node in /core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php on line 83

Any idea ?

Thanks