When attempting to execute the following Ant script, which runs the "npm" command:
<target name ="test">
<exec executable="npm" failonerror="true">
<arg value="install" />
</exec>
</target>
An error occurs, indicating:
Execute failed: java.io.IOException: Cannot run program "npm"
(in directory "C:\Development\workspace\traqpath\WebSource"):
CreateProcess error=2, The system cannot find the file specified
Similar issue arises when trying to execute the Angular-CLI "ng" command:
<target name ="test">
<exec executable="ng" failonerror="true">
<arg value="build"/>
<arg value="--prod"/>
<arg value="--bh"/>
</exec>
</target>
The same error message is displayed for "ng":
Execute failed: java.io.IOException: Cannot run program "ng"
(in directory "C:\Development\workspace\traqpath\WebSource"):
CreateProcess error=2, The system cannot find the file specified
Despite both commands executing successfully in the Windows Command Line, it seems there may be a discrepancy in the NodeJS installation or PATH system variable configuration.