0
votes

Jenkins installed in CentOS and installed Node version v14.16.0 also npm version 6.14.11

Failing to execute npm commands like npm install, npm cache clean --force etc via Jenkins job. Showing /usr/bin/env: node: No such file or directory in the job console. Same is working fine when we run the same command in the terminal.

enter image description here

1
either npm or node command is not visible to jenkins user. When ever you run a job in Jenkins , Jenkins use jenkins user. make sure jenkins user have access to all the needed tool you need for your build.Samit Kumar Patel

1 Answers

0
votes

After executing following it started working

sudo ln -sf "$(which node)" /usr/bin/node