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.

2
  • 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. Commented Mar 16, 2022 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 Commented Mar 17, 2022 at 4:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.