2017-03-27 63 views
0

我試圖在運行於Travis-CI下的Ubuntu 14上安裝npm軟件包。如何在Ubuntu 14下安裝npm在Travis-CI

它安裝罰款我的本地Ubuntu的安裝14,但特拉維斯,它失敗,出現錯誤:

[127.0.0.1] out: dpkg: error processing archive /var/cache/apt/archives/npm_1.3.10~dfsg-1_all.deb (--unpack): 
[127.0.0.1] out: trying to overwrite '/usr/bin/npm', which is also in package nodejs 0.12.7-rwky1~trusty 
[127.0.0.1] out: Processing triggers for man-db (2.6.7.1-1ubuntu1) ... 
[127.0.0.1] out: Errors were encountered while processing: 
[127.0.0.1] out: /var/cache/apt/archives/npm_1.3.10~dfsg-1_all.deb 
[127.0.0.1] out: E: Sub-process /usr/bin/dpkg returned an error code (1) 
[127.0.0.1] out: 
Fatal error: sudo() received nonzero return code 100 while executing! 
Requested: apt-get update --fix-missing; DEBIAN_FRONTEND=noninteractive apt-get install --yes npm 
Executed: sudo -S -p 'sudo password:' /bin/bash -l -c "apt-get update --fix-missing; DEBIAN_FRONTEND=noninteractive apt-get install --yes npm" 

我該如何解決這個問題?

回答

0

我有同樣的問題,並通過而不是解決它試圖安裝npm包。

以我爲例,我是用trusty ci environment on Travis並推斷它來pre-installed with nodejs(因此,NPM - 我認爲)。所以,從我的回購的.travis.yml文件,我只是去掉,我試圖安裝線路npm(在我的情況:- sudo apt-get install -y npmbefore_install部分)和的install部分與像npm install和命令等npm用法通過構建.travis.yml文件成功執行。

我希望有幫助!