2016-11-11 222 views
1

在構建代理程序中在teamcity中編譯項目時出現以下錯誤。這是兩天前對同一個代理工作,現在給出以下錯誤。請幫忙。npm install npm err退出狀態8

我已經更新了完整的日誌,如果有幫助。這是我在新創建的teamcity中失敗的原因。我正在爲應用程序提供支持,但仍在學習如何調試這些問題。任何幫助,將不勝感激,即使在外行的條件。多謝你們。

Step 1/5: install dependencies (Node.js NPM) (12s) 
    [Step 1/5] npm install (12s) 
[npm install] Executing npm via wrapping shell script 
[npm install] Starting: /opt/home/teamcity/BuildAgent2/temp/agentTmp/wrapper3833224454633074147.sh install 
[npm install] in directory: /opt/home/teamcity/BuildAgent2/work/cd110a4ceada3f8c 
[npm install] npm WARN package.json [email protected] No repository field. 
[npm install] npm WARN engine [email protected]: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.38","npm":"1.4.28"}) 
[npm install] npm WARN engine [email protected]: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.38","npm":"1.4.28"}) 
[npm install] npm WARN engine [email protected]: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.38","npm":"1.4.28"}) 
[npm install] 
[npm install] > [email protected] install /opt/home/teamcity/BuildAgent2/work/cd110a4ceada3f8c/node_modules/karma-phantomjs-launcher/node_modules/phantomjs-prebuilt 
[npm install] > node install.js 
[npm install] 
[npm install] 
[npm install] module.js:340 
[npm install]  throw err; 
[npm install]   ^
[npm install] Error: Cannot find module '/opt/home/teamcity/BuildAgent2/work/cd110a4ceada3f8c/node_modules/karma-phantomjs-launcher/node_modules/phantomjs-prebuilt/install.js' 
[npm install]  at Function.Module._resolveFilename (module.js:338:15) 
[npm install]  at Function.Module._load (module.js:280:25) 
[npm install]  at Function.Module.runMain (module.js:497:10) 
[npm install]  at startup (node.js:119:16) 
[npm install]  at node.js:935:3 
[npm install] npm WARN engine [email protected]: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.38","npm":"1.4.28"}) 
[npm install] npm WARN engine [email protected]: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.38","npm":"1.4.28"}) 
[npm install] npm WARN engine [email protected]: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.38","npm":"1.4.28"}) 
[npm install] 
[npm install] > [email protected] install /opt/home/teamcity/BuildAgent2/work/cd110a4ceada3f8c/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs-prebuilt 
[npm install] > node install.js 
[npm install] 
[npm install] 
[npm install] module.js:340 
[npm install]  throw err; 
[npm install]   ^
[npm install] Error: Cannot find module '/opt/home/teamcity/BuildAgent2/work/cd110a4ceada3f8c/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs-prebuilt/install.js' 
[npm install]  at Function.Module._resolveFilename (module.js:338:15) 
[npm install]  at Function.Module._load (module.js:280:25) 
[npm install]  at Function.Module.runMain (module.js:497:10 
[npm install]  at startup (node.js:119:16) 
[npm install]  at node.js:935:3 
[npm install] 

[npm install] npm ERR! [email protected] install: `node install.js` 
    [npm install] npm ERR! Exit status 8 
    [npm install] npm ERR! 
    [npm install] npm ERR! Failed at the [email protected] install script. 
    [npm install] npm ERR! This is most likely a problem with the phantomjs-prebuilt package, 
    [npm install] npm ERR! not with npm itself. 
    [npm install] npm ERR! Tell the author that this fails on your system: 
    [npm install] npm ERR! node install.js 
    [npm install] npm ERR! You can get their info via: 
    [npm install] npm ERR! npm owner ls phantomjs-prebuilt 
    [npm install] npm ERR! There is likely additional logging output above. 
    [npm install] npm ERR! System Linux 2.6.18-409.el5 
    [npm install] npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" 
    [npm install] npm ERR! cwd /opt/home/teamcity/BuildAgent2/work/cd110a4ceada3f8c 
    [npm install] npm ERR! node -v v0.10.38 
    [npm install] npm ERR! npm -v 1.4.28 
    [npm install] npm ERR! code ELIFECYCLE 
    [npm install] npm ERR! not ok code 0 
    [Step 1/5] Step install dependencies (Node.js NPM) failed 
+0

嘗試'npm install --verbose'以獲得更多輸出。最有可能是關於phantomjs後安裝腳本 – smnbbrv

+0

也許更改構建依賴關係中的phantomjs的版本號從「*」到前一個 – InsOp

回答

0

看起來它試圖安裝最新的軟件包,並且已經損壞。編輯你的package.json並找到PhantomJS的版本。它看起來是這樣的:

"phantomjs-prebuilt": "^2.1.7" 

拿出它前面的「^」來安裝精確指定的版本。您的構建失敗,因爲它試圖安裝指定包的更新版本,並且該包已損壞。 「^」告訴是安裝至少指定的版本,但獲取最新的版本。

+0

嗨@boyan 我很新,因爲我們提供的支持和構建失敗團隊中的其他人在某個特定的代理人身上,但在其他代理人身上工作。我必須爲用戶解決這個問題。有什麼辦法嗎? – Jayesh

+0

如果您的構建正在處理其他代理但不在一個代理上,那麼這是該代理的問題,或者它可能是您的package.json文件的問題。你能否更新你的問題來提供package.json? –