0
<target name ="npm-install">
<exec dir="${pathToSomeDir}" executable="npm.cmd" failonerror="true">
    <arg value="install" />
</exec>

I am doing npm install with this task which is running fine only if I have nodejs path in my system variable I want to do this task without having nodejs path in the system variable is there any workaround for this? if available please tell for UNIX too. p.s :- in ${pathToSomeDir} there is package.json and scripts etc.

  • If with `system variable` you mean the `PATH` variable you should be able to provide the full path to NodeJS in the command parameter e.g. `/home/myuse/.nvm/versions/node/v17.3.1/bin/npm`. – Mushroomator Mar 16 '22 at 20:12
  • i am running this command by giving full path C:\somefolder\nodejs\npm.cmd install OR C:\somefolder\nodejs\npm install it needs node in path only then it executes else it give error node is not recognized – gson.json Mar 17 '22 at 04:12

0 Answers0