Wedriverio jenkins - npm command not found error

I try to run a webdriverio test from Jenkins and follow this . I installed the plugin nodeJSfor jenkins and in the global configuration tool for NodeJS added the name and installation directory as /usr/local/bin(the node executable file is in this folder)

In Jenkins, in the project configuration, in the build environment, I checked

Provide Node & npm bin/folder to PATH and select the host installation name from the previous step

But when I try to run npm install npm testby adding these commands to the execute shell command under Build and compiling it, I get this error

Building in workspace /Users/Shared/Jenkins/Home/workspace/wdio-project
[wdio-project] $ /bin/sh -xe /Users/Shared/Jenkins/tmp/hudson1478028169114509075.sh
+ npm install
/Users/Shared/Jenkins/tmp/hudson1478028169114509075.sh: line 2: npm: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
+5
source share
5 answers

- ​​ , , export PATH=/usr/local/bin execute .

+4

(JENKINS-26583 JENKINS-27170)

, node PATH, :

export PATH=$PATH:/home/jenkins/.jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node_js/bin/
+2

, . , . , Jenkins npm, debian, .

0

PATH =/usr/local/bin: $ PATH

0

NodeJS

0

Source: https://habr.com/ru/post/1660225/


All Articles