2017-03-06 169 views
0

我試圖構建一個類似於此的示例角度2應用程序: https://github.com/angular/quickstart.git quickstart。在Jenkins構建Angular 2應用程序

我已經將此項目克隆到我的存儲庫中,但除了在Jenkins上安裝節點之外,我不確定還需要修改哪些內容才能使構建成功。我需要安裝什麼依賴項才能工作?

我正在運行的唯一腳本是npm install,並且作業仍然失敗。

這是控制檯的結果:

[EnvInject] - Loading node environment variables. 
Building remotely on r008p8p0c TPC (bxp2-prod linuxCleanUp) in workspace /bxp/jen/slave99/workspace/wmz-angular 
> /usr/bin/git rev-parse --is-inside-work-tree # timeout=10 
Fetching changes from the remote Git repository 
> /usr/bin/git config remote.origin.url https://git.url # timeout=10 
Fetching upstream changes from https://git.url 
> /usr/bin/git --version # timeout=10 
using GIT_ASKPASS to set credentials git 
> /usr/bin/git fetch --tags --progress https://git.url +refs/heads/*:refs/remotes/origin/* 
> /usr/bin/git rev-parse refs/remotes/origin/feature/ruth-3-6-17^{commit} # timeout=10 
> /usr/bin/git rev-parse refs/remotes/origin/origin/feature/ruth-3-6-17^{commit} # timeout=10 
Checking out Revision 61164adcfa55d6ee096b6969b8c043187ae1fa88 (refs/remotes/origin/feature/ruth-3-6-17) 
> /usr/bin/git config core.sparsecheckout # timeout=10 
> /usr/bin/git checkout -f 61164adcfa55d6ee096b6969b8c043187ae1fa88 
> /usr/bin/git rev-list 61164adcfa55d6ee096b6969b8c043187ae1fa88 # timeout=10 
[wmz-angular] $ /bxp/jen/slave99/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_0.12.9_v8/bin/node /tmp/hudson1546788266894720709.js 
/tmp/hudson1546788266894720709.js:1 
(function (exports, require, module, __filename, __dirname) { npm install 
                    ^^^^^^^ 
SyntaxError: Unexpected identifier 
    at exports.runInThisContext (vm.js:73:16) 
    at Module._compile (module.js:443:25) 
    at Object.Module._extensions..js (module.js:478:10) 
    at Module.load (module.js:355:32) 
    at Function.Module._load (module.js:310:12) 
    at Function.Module.runMain (module.js:501:10) 
    at startup (node.js:129:16) 
    at node.js:814:3 
Build step 'Execute NodeJS script' marked build as failure 
[BFA] Scanning build for known causes... 
[BFA] No failure causes found 
[BFA] Done. 0s 
Finished: FAILURE 
+1

你,而你的工作無法得到任何錯誤訊息? – lin

+0

您是否正確配置了Jenkins工作? – playerone

+0

如果沒有看到工作失敗的原因,你會很難幫助你。請更新您的問題以包含失敗作業的日誌。 – lax1089

回答

0

使用execute cmd/bash commands運行你的命令。 Execute NodeJS script希望.js文件可以像node index.js一樣運行。

npm install不是有效的腳本的NodeJS,它只是一個命令來安裝NPM模塊

+0

謝謝。這解決了這個問題。 – user1324418

相關問題