Multiple errors with npm

Linux Debian.
ThreeJs installation via npm: npm -i --save -g three
Context:
I have issues with Nodes packages and apparently anything shader related.
Normal materials run fine but I desperately need triplanar mapping.
A babylonJS equivalent would have been marvelous.

When running that code and changing the light from hemi to, say DirectionalLight, I get:

WebGL warning: linkProgram: Must have a compiled fragment shader attached:
SHADER_INFO_LOG:
ERROR: 0:408: 'directionalShadowMap' : undeclared identifier
ERROR: 0:408: 'expression' :  left of '[' is not of type array, matrix, or vector 
ERROR: 0:408: 'directionalLightShadows' : undeclared identifier
ERROR: 0:408: 'expression' :  left of '[' is not of type array, matrix, or vector 
ERROR: 0:408: 'shadowMapSize' :  field selection requires structure, vector, or interface block on left hand side
ERROR: 0:408: 'directionalLightShadows' : undeclared identifier
ERROR: 0:408: 'expression' :  left of '[' is not of type array, matrix, or vector 
ERROR: 0:408: 'shadowBias' :  field selection requires structure, vector, or interface block on left hand side
ERROR: 0:408: 'directionalLightShadows' : undeclared identifier
ERROR: 0:408: 'expression' :  left of '[' is not of type array, matrix, or vector 
ERROR: 0:408: 'shadowRadius' :  field selection requires structure, vector, or interface block on left hand side
ERROR: 0:408: 'v_vec4_49' : undeclared identifier
ERROR: 0:408: 'expression' :  left of '[' is not of type array, matrix, or vector 
ERROR: 0:408: 'getShadow' : no matching overloaded function found

It seems related to Threejs because others already had this issue with a different code, hence why I am not bothering the library author anymore.
Again, I always have problem when tinkering with shaders, using a library or not. My preceding Nodes.* experience led to errors/crash as well.

May someone try and eventually provide some guidance please?

According to this SO, what I need is to configure shadows manually.

const directionalLight = new THREE.DirectionalLight(0xffffbb, 0.3);

var d = 5;
directionalLight.castShadow = true;
directionalLight.shadow.camera.left = - d;
directionalLight.shadow.camera.right = d;
directionalLight.shadow.camera.top = d;
directionalLight.shadow.camera.bottom = - d;
directionalLight.shadow.camera.near = 1;
directionalLight.shadow.camera.far = 20;

scene.add(directionalLight);

Did the trick. So the trick here is to set the cast shadow manually…