我正在建立一个拥有jenkins for CI的ubuntu服务器.
当我尝试运行构建时,我会失败
问题:
如何npm install从我的詹金斯工作中完成工作?
构建1:
[morningharwood] $ /bin/sh -xe /tmp/hudson8925730298288495807.sh
+ pwd
/var/lib/jenkins/workspace/morningharwood
+ ls
bower.json
client
e2e
Gruntfile.js
karma.conf.js
package.json
protractor.conf.js
server
+ npm install
/tmp/hudson8925730298288495807.sh: 5: /tmp/hudson8925730298288495807.sh: npm: not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Run Code Online (Sandbox Code Playgroud)
詹金建立

更新:
~$ pwd
/home/ubuntu
ls -a
. .bash_history .bashrc .config .gem .gnupg .node-gyp .nvm .rbenv .ssh .viminfo
.. .bash_logout .cache .dotfiles .gemrc .local .npm .profile .rvm .vim
Run Code Online (Sandbox Code Playgroud)
现在我看到了 .npm
+ /home/ubuntu/.npm/npm install …Run Code Online (Sandbox Code Playgroud) 我正在尝试从jenkins运行webdriverio测试并遵循此.我nodeJS为jenkins 安装了插件,在全局工具配置下,对于NodeJS,添加了一个名称和安装目录/usr/local/bin(节点可执行文件在此文件夹中)
在Jenkins中,在项目配置中,在构建环境下,我已经检查过了
Provide Node & npm bin/ folder to PATH 并从上一步骤中选择节点安装名称
但是当我试图运行时npm install
npm test,通过在Build下构建它的execute shell下添加这些命令,我收到了这个错误
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
Run Code Online (Sandbox Code Playgroud) Jenkins的新手:我正在Jenkins建立我们的构建.设置构建步骤以运行nodejs脚本(使用Sencha Touch 2将构建的应用程序带入本机iOS应用程序的脚本).nodejs脚本需要一个扳手库.
Jenkins用户似乎在不同的上下文中运行.它无法看到我的节点安装或npm安装.作为构建步骤的一部分,我必须将路径导出到node和npm.现在我已经完成了,构建会看到node和npm命令.
但是,我在构建步骤中调用的其中一个命令是'npm install wrench',它给我一个权限错误,并告诉我以管理员身份运行.所以我可以让它发挥作用.
因此,我需要能够为Jenkins用户提供管理员权限,或者我需要提前npm为用户安装软件包.有谁知道如何做这些选项中的任何一个.