找不到Jenkins jasmine-node命令 [英] Jenkins jasmine-node command not found

查看:265
本文介绍了找不到Jenkins jasmine-node命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Jenkins配置为可用于在node.js项目上工作的团队.我们在大多数项目中都使用了茉莉花节点.

I am trying to configure Jenkins to be used for my team which works on node.js projects. We used jasmine-node for most of our projects.

我有一个jenkins实例,由组织中的另一个组管理,该组可以识别node和npm.

I have a jenkins instance managed by another group in the org which recognizes node and npm.

我运行了'npm install -g jasmine-node'作为Jenkins的工作之一,并且库恩索尔的输出显示它是成功的:

I ran 'npm install -g jasmine-node' as one of the Jenkins job and the coonsole output says it is successfull:

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
jasmine-node@1.14.5 C:\Windows\system32\config\systemprofile\AppData\Roaming\npm\node_modules\jasmine-node
â"œâ"€â"€ mkdirp@0.3.5
â"œâ"€â"€ underscore@1.8.3
â"œâ"€â"€ walkdir@0.0.11
â"œâ"€â"€ coffee-script@1.10.0
â"œâ"€â"€ jasmine-growl-reporter@0.0.3 (growl@1.7.0)
â"œâ"€â"€ requirejs@2.1.20
â"œâ"€â"€ jasmine-reporters@1.0.2
â""â"€â"€ gaze@0.3.4 (minimatch@0.2.14, fileset@0.1.8)
Sending e-mails to: snehil.wakchaure1@cerner.com
Finished: SUCCESS

但是,当我在Jenkins shell中使用命令"jasmine-node"运行作业的茉莉花测试时.然后jenkins服务器说找不到jasmine-node命令,如下所示:

But when i run the jasmine tests in Jenkins shell for the job with the command 'jasmine-node .' then the jenkins server says that jasmine-node command is not found as shown below:

    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: snehil.wakchaure1@cerner.com
[BFA] Scanning build for known causes...

[BFA] Done. 0s
Finished: FAILURE

我不确定如何在詹金斯盒子上安装茉莉花节点.

I am not sure how to install jasmine-node on the jenkins box.

我是否必须将茉莉花节点添加到PATH才能起作用?如果是,我该怎么办?

Do i have to add the jasmine-node to PATH for this to work? If yes, how do i do so?

请告知

谢谢

推荐答案

我认为您必须将npm二进制文件添加到路径中. 查找您的npm全局二进制文件的位置:npm config get prefix.可能类似于C:\Users\username\AppData\Roaming\npm

I think you have to add the npm binary to your path. Find the location of your npm global binaries: npm config get prefix. It's probably something like C:\Users\username\AppData\Roaming\npm

转到全局属性->环境变量"并添加PATH,其值为:$PATH:/C:/Users/username/AppData/Roaming/npm

Go to "Global Properties -> Environment Variables" and add PATH, with value: $PATH:/C:/Users/username/AppData/Roaming/npm

这篇关于找不到Jenkins jasmine-node命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆