2
我的版本在Travis CI上失敗,因爲uglify-js
將不會安裝。輸出日誌的相關部分如下。我正在安裝nodejs
和npm
,因爲這是一個language: cpp
構建而不是language: node_js
構建(其C++庫與其他語言的綁定,包括一些客戶端JavaScript需要縮小)。如何在Travis CI上安裝uglify-js?
$ sudo apt-get install nodejs npm --force-yes --assume-yes --fix-broken
$ sudo npm install -g uglify-js
npm http GET https://registry.npmjs.org/uglify-js
npm ERR! Error: failed to fetch from registry: uglify-js
npm ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR! at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR! at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR! at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58)
npm ERR! at Request.emit (events.js:88:20)
npm ERR! at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:412:12)
npm ERR! at ClientRequest.emit (events.js:67:17)
npm ERR! at HTTPParser.onIncoming (http.js:1261:11)
npm ERR! at HTTPParser.onHeadersComplete (http.js:102:31)
npm ERR! You may report this log at:
npm ERR! <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR! reportbug --attach /home/travis/build/stencila/stencila/npm-debug.log npm
npm ERR!
npm ERR! System Linux 2.6.32-042stab094.7
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "uglify-js"
npm ERR! cwd /home/travis/build/stencila/stencila
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: uglify-js
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/travis/build/stencila/stencila/npm-debug.log
npm not ok
The command "sudo npm install -g uglify-js" failed and exited with 1 during .
根據http://docs.travis-ci.com/user/ci-environment/#Runtimes'nodejs'(和'npm'?)應該已經安裝。但是當我刪除上面的apt-get行時,我得到了'sudo:npm:command not found'。 – nokome
嗨,我只是嘗試了一個簡單的[.travis.yml](https://github.com/cotsog/travisci_nodejs/blob/master/.travis.yml)文件,它似乎工作,而不必安裝'npm'事先通過'apt-get'。這是我的[生成日誌](https://travis-ci.org/cotsog/travisci_nodejs/builds/64033106)。 (即使構建失敗,日誌顯示我可以成功調用uglifyjs。)您能否提供.travis.yml文件? –