Getting Unexpected end of JSON input

I am Trying to load gltfLoader at node js server side but i will give that error.
if i will run script in browser then it will working fine but not at server side

 global.XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
 global.THREE = require('/home/visilean/Ravi/HoungCode/threebim/js/libsCore/three');
 const GLTFLoader = require('/home/visilean/Ravi/HoungCode/threebim/js/libs/loaders/GLTFLoader.js');
 const loader = new THREE.GLTFLoader();
     ( gltf ) => {
         // called when the resource is loaded
         scene.add( gltf.scene );
   ( xhr ) => {
        // called while loading is progressing
         console.log( `${( xhr.loaded / * 100 )}% loaded` );
     ( error ) => {
         console.error( 'An error happened', error );

i will getting that below error.

An error happened SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at GLTFLoader.parse (/home/visilean/Ravi/HoungCode/threebim/js/libs/loaders/GLTFLoader.js:139:20)
    at Object.onLoad (/home/visilean/Ravi/HoungCode/threebim/js/libs/loaders/GLTFLoader.js:62:12)
    at exports.XMLHttpRequest.<anonymous> (/home/visilean/Ravi/HoungCode/threebim/js/libsCore/three.js:31780:40)
    at exports.XMLHttpRequest.dispatchEvent (/home/visilean/Ravi/HoungCode/threebim/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:595:29)
    at setState (/home/visilean/Ravi/HoungCode/threebim/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:614:14)
    at IncomingMessage.<anonymous> (/home/visilean/Ravi/HoungCode/threebim/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:447:13)

I don’t think this is a three.js related issue. If JSON.parse() produces a runtime error, there is something wrong with the emulated XHR request on node.js.

any alternate way to run GLTFLoader at node js back end side intends browser ?

Read this topic for more information. It seems loading a glb makes the usage in context of node.js easier: