You could pass x in arguments when calling check.js
Assuming you have check.js located in a folder like this c:\apps\check.js here is some code you can try:
start.php
<?php
$x = 5;
$output = shell_exec("node.exe c:\apps\check.js x=$x");
echo "<pre>$output</pre>";
?>
c:\apps\check.js
const querystring = require('querystring');
const data = querystring.parse( process.argv[2] || '' );
const x = data.x;
console.log(x);
Node.js code is using querystring module (https://nodejs.org/api/querystring.html) for parsing x.
Update (if you need to pass more than one value)
start.php
<?php
$x = 5;
$y = 7;
$output = shell_exec("node.exe c:\apps\check.js x=$x+y=$y");
echo "<pre>$output</pre>";
?>
c:\apps\check.js
const querystring = require('querystring');
const data = querystring.parse( process.argv[2] || '', '+' );
console.log(data.x);
console.log(data.y);
I hope this helps.