首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到Jenkins jasmine-node命令

找不到Jenkins jasmine-node命令
EN

Stack Overflow用户
提问于 2015-11-18 23:36:15
回答 1查看 847关注 0票数 0

我正在尝试将Jenkins配置为用于我的团队,该团队致力于node.js项目。我们在大多数项目中都使用了jasmine-node。

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

我运行'npm install -g jasmine-node‘作为Jenkins作业之一,coonsole输出显示成功:

代码语言:javascript
复制
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‘命令为作业运行jasmine测试时。然后jenkins服务器显示找不到jasmine-node命令,如下所示:

代码语言:javascript
复制
    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

我不知道如何在jenkins机器上安装jasmine-node。

我必须将jasmine-node添加到PATH中才能正常工作吗?如果是,我该怎么做?

请指教,

谢谢

EN

回答 1

Stack Overflow用户

发布于 2015-11-20 17:10:32

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

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33784211

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档