Skip to main content
Solved

Modern UI 2024R2

  • December 27, 2024
  • 2 replies
  • 114 views

I have installed training instance - SmartFix_T290 and following “Modern UI Development: Building of the Source Code” course.

On step 3. Use Windows PowerShell or a similar program to run the following command in the FrontendSources folder.

npm run getmodules

receive error message 

 Starting 'i_controls outlook-plugin'...
[11:37:54] 'i_controls outlook-plugin' errored after 5.49 ms
[11:37:54] Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:421:11)
    at spawn (node:child_process:753:9)

Use local instance with http: request.

Outlook-pugin can only be used on https.

 

Any idea how to fix this problem?

Best answer by Marco Villasenor

Hi ​@nadiyahnatyuk58 this is caused by a security update in Node.js. Specifically, if your Node.js version is v18 or newer.

Here is more detail from the security update:

It is important to note that there has been a breaking change for Windows users who utilize child_process.spawn and child_process.spawnSync. Node.js will now error with EINVAL if a .bat or .cmd file is passed to child_process.spawn and child_process.spawnSync without the shell option set. If the input to spawn/spawnSync is sanitized, users can now pass { shell: true } as an option to prevent the occurrence of EINVALs errors.

Since the command calls the spawn method without the “shell” option, the script fails with that error.

I fixed it by adding the option in the gulp-tools.ts file that is in the /FrontendSources folder. Just modify line 108 to look like this:


    const cmd = spawn(command, args, { cwd, shell: true });

After this the command should run without issues.

View original
Did this topic help you find an answer to your question?

2 replies

Marco Villasenor
Jr Varsity II
Forum|alt.badge.img+2

Hi ​@nadiyahnatyuk58 this is caused by a security update in Node.js. Specifically, if your Node.js version is v18 or newer.

Here is more detail from the security update:

It is important to note that there has been a breaking change for Windows users who utilize child_process.spawn and child_process.spawnSync. Node.js will now error with EINVAL if a .bat or .cmd file is passed to child_process.spawn and child_process.spawnSync without the shell option set. If the input to spawn/spawnSync is sanitized, users can now pass { shell: true } as an option to prevent the occurrence of EINVALs errors.

Since the command calls the spawn method without the “shell” option, the script fails with that error.

I fixed it by adding the option in the gulp-tools.ts file that is in the /FrontendSources folder. Just modify line 108 to look like this:


    const cmd = spawn(command, args, { cwd, shell: true });

After this the command should run without issues.


Thank you Marco! It worked!!!

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings