當我試圖運行下面的Ant腳本,它執行「故宮」命令:運行NPM,NG使用Windows Ant腳本命令,「系統找不到指定的文件」的錯誤
<target name ="test">
<exec executable="npm" failonerror="true">
<arg value="install" />
</exec>
</target>
它失敗,此錯誤:
:當我嘗試運行角CLI 「NG」命令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
同樣的情況,
<target name ="test">
<exec executable="ng" failonerror="true">
<arg value="build"/>
<arg value="--prod"/>
<arg value="--bh"/>
</exec>
</target>
在相同的錯誤消息,但對於「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
兩個命令運行而無需在Windows命令行,這意味着的NodeJS安裝正確的問題,的NodeJS路徑在正確配置PATH系統變量。
我的新Ant腳本看起來像現在這樣:
直到明天,我被允許:) – Ghayth