2015-11-18 93 views
0

我正在尝试将Jenkins配置为用于我的团队,该团队在node.js项目上工作。我们大部分项目都使用了jasmine-node。Jenkins jasmine-node命令未找到

我有一个jenkins实例由org中的另一个组管理,它识别node和npm。

我跑了“故宫安装-g茉莉节点”作为詹金斯的工作之一,并在coonsole输出说,这是全成:

Building on master in workspace C:\.jenkins\workspace\ttm-closr 
> git rev-parse --is-inside-work-tree 
Fetching changes from the remote Git repository 
> git config remote.origin.url https://github.cerner.com/ApplicationServices/ttm-closr.git 
Fetching upstream changes from https://github.cerner.com/ApplicationServices/ttm-closr.git 
> git --version 
using .gitcredentials to set credentials 
> git config --local credential.helper store --file=\"C:\Temp\git2392678818489855660.credentials\" 
> git fetch --tags --progress https://github.cerner.com/ApplicationServices/ttm-closr.git +refs/heads/*:refs/remotes/origin/* 
> git config --local --remove-section credential 
> git rev-parse "origin/master^{commit}" 
Checking out Revision 2b8831b19eb22f5d38652ab0b2dd230e2e5cf5d8 (origin/master) 
> git config core.sparsecheckout 
> git checkout -f 2b8831b19eb22f5d38652ab0b2dd230e2e5cf5d8 
> git rev-list 2b8831b19eb22f5d38652ab0b2dd230e2e5cf5d8 
[ttm-closr] $ sh -xe C:\Temp\hudson1199475728575930889.sh 
+ npm install -g jasmine-node 
C:\Windows\system32\config\systemprofile\AppData\Roaming\npm\jasmine-node -> C:\Windows\system32\config\systemprofile\AppData\Roaming\npm\node_modules\jasmine-node\bin\jasmine-node 
[email protected] C:\Windows\system32\config\systemprofile\AppData\Roaming\npm\node_modules\jasmine-node 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] ([email protected]) 
├── [email protected] 
├── [email protected] 
└── [email protected] ([email protected], [email protected]) 
Sending e-mails to: [email protected] 
Finished: SUCCESS 

但是当我运行在詹金斯茉莉花测试外壳作业命令'茉莉节点'。那么服务器詹金斯说,茉莉节点命令没有找到,如下图所示:

Building on master in workspace C:\.jenkins\workspace\ttm-closr 
> git rev-parse --is-inside-work-tree 
Fetching changes from the remote Git repository 
> git config remote.origin.url https://github.cerner.com/ApplicationServices/ttm-closr.git 
Fetching upstream changes from https://github.cerner.com/ApplicationServices/ttm-closr.git 
> git --version 
using .gitcredentials to set credentials 
> git config --local credential.helper store --file=\"C:\Temp\git7724050299130064334.credentials\" 
> git fetch --tags --progress https://github.cerner.com/ApplicationServices/ttm-closr.git +refs/heads/*:refs/remotes/origin/* 
> git config --local --remove-section credential 
> git rev-parse "origin/master^{commit}" 
Checking out Revision 2b8831b19eb22f5d38652ab0b2dd230e2e5cf5d8 (origin/master) 
> git config core.sparsecheckout 
> git checkout -f 2b8831b19eb22f5d38652ab0b2dd230e2e5cf5d8 
> git rev-list 2b8831b19eb22f5d38652ab0b2dd230e2e5cf5d8 
[ttm-closr] $ sh -xe C:\Temp\hudson2835855030225455242.sh 
+ jasmine-node . 
C:\Temp\hudson2835855030225455242.sh: line 2: jasmine-node: command not found 
Build step 'Execute shell' marked build as failure 
Sending e-mails to: [email protected] 
[BFA] Scanning build for known causes... 

[BFA] Done. 0s 
Finished: FAILURE 

我不知道如何在詹金斯箱安装茉莉节点。

我必须将茉莉花节点添加到PATH才能正常工作吗?如果是的话,我该怎么做?

请指教,

感谢

回答

0

我认为你必须故宫二进制添加到您的路径。 查找npm全局二进制文件的位置:npm config get prefix。这大概就像C:\Users\username\AppData\Roaming\npm

进入“全局属性 - >环境变量”,并添加PATH,与价值:$PATH:/C:/Users/username/AppData/Roaming/npm