最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to execute NPM command in Jenkins via shell - Stack Overflow

programmeradmin0浏览0评论

I am getting a syntax error when trying to execute the "npm" mand

Users/Shared/Jenkins/Home/workspace/projectName/npm test
                                                     ^^^^

SyntaxError: Unexpected identifier

Here is the Jenkins Build shell mand that I used:

#!/usr/local/bin/node

Users/Shared/Jenkins/Home/workspace/kaleidoscope/npm test

Can anyone explain what happened?

I am getting a syntax error when trying to execute the "npm" mand

Users/Shared/Jenkins/Home/workspace/projectName/npm test
                                                     ^^^^

SyntaxError: Unexpected identifier

Here is the Jenkins Build shell mand that I used:

#!/usr/local/bin/node

Users/Shared/Jenkins/Home/workspace/kaleidoscope/npm test

Can anyone explain what happened?

Share Improve this question edited Mar 21, 2018 at 20:24 Marvin 2291 gold badge3 silver badges11 bronze badges asked Mar 21, 2018 at 19:17 LysertyLyserty 3454 silver badges14 bronze badges 1
  • what output does sh('which npm') have? – FCh Commented Mar 21, 2018 at 19:30
Add a ment  | 

1 Answer 1

Reset to default 3

This stack question basically gave me an answer. I didn't't install NodeJS plugin.

how to run npm/grunt mand from jenkins

So, to trigger npm mands in Jenkins install and configure NodeJS plugin. https://wiki.jenkins.io/display/JENKINS/NodeJS+Plugin

发布评论

评论列表(0)

  1. 暂无评论