2016-05-08 29 views
0

私は本当にnpmをインストールするのに苦労しています。ubuntuにnpmをインストールする

[email protected]:~$ sudo apt-get install nodejs 
Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
nodejs is already the newest version. 
The following packages were automatically installed and are no longer required: 
    authbind diffstat hardening-includes libapt-pkg-perl libarchive-zip-perl 
    libbonobo2-0 libbonobo2-common libcamel-1.2-29 libclass-accessor-perl 
    libclone-perl libedataserver-1.2-15 libemail-valid-perl libgles1-mesa 
    libgnome2-0 libgnome2-bin libgnome2-common libidl-common libidl0 
    libindicate5 libio-pty-perl libio-string-perl libipc-run-perl 
    libnet-dns-perl libnet-domain-tld-perl libnet-ip-perl liborbit2 
    libperlio-gzip-perl libpoppler19 libqt5x11extras5 libsdl-image1.2 
    libtext-levenshtein-perl libtiff4 libva-drm1 libxcb-composite0 libxcb-xv0 
    linux-headers-4.2.0-16 linux-headers-4.2.0-16-generic 
    linux-image-4.2.0-16-generic linux-image-extra-4.2.0-16-generic patchutils 
    t1utils vlc-plugin-notify vlc-plugin-samba 
Use 'apt-get autoremove' to remove them. 
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded. 
[email protected]:~$ npm -v 
The program 'npm' is currently not installed. You can install it by typing: 
sudo apt-get install npm 

[email protected]:~$ sudo apt-get install npm 
Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
Some packages could not be installed. This may mean that you have 
requested an impossible situation or if you are using the unstable 
distribution that some required packages have not yet been created 
or been moved out of Incoming. 
The following information may help to resolve the situation: 

The following packages have unmet dependencies: 
npm : Depends: nodejs-dev but it is not going to be installed 
E: Unable to correct problems, you have held broken packages. 

[email protected]:~$ sudo apt-get install nodejs-dev 
Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
Some packages could not be installed. This may mean that you have 
requested an impossible situation or if you are using the unstable 
distribution that some required packages have not yet been created 
or been moved out of Incoming. 
The following information may help to resolve the situation: 

The following packages have unmet dependencies: 
nodejs-dev : Depends: libssl-dev (>= 1.0.0g) but it is not going to be installed 
E: Unable to correct problems, you have held broken packages. 

[email protected]:~$ sudo apt-get install libssl-dev 
Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
Some packages could not be installed. This may mean that you have 
requested an impossible situation or if you are using the unstable 
distribution that some required packages have not yet been created 
or been moved out of Incoming. 
The following information may help to resolve the situation: 

The following packages have unmet dependencies: 
libssl-dev : Depends: libssl1.0.0 (= 1.0.1-4ubuntu5.36) but 1.0.2d-0ubuntu1.4 is to be installed 
       Depends: zlib1g-dev but it is not going to be installed 
       Recommends: libssl-doc but it is not going to be installed 
E: Unable to correct problems, you have held broken packages. 

[email protected]:~$ sudo apt-get install zlib1g-dev 
Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
Some packages could not be installed. This may mean that you have 
requested an impossible situation or if you are using the unstable 
distribution that some required packages have not yet been created 
or been moved out of Incoming. 
The following information may help to resolve the situation: 

The following packages have unmet dependencies: 
zlib1g-dev : Depends: zlib1g (= 1:1.2.3.4.dfsg-3ubuntu4) but 1:1.2.8.dfsg-2ubuntu4 is to be installed 
E: Unable to correct problems, you have held broken packages. 

それは、依存関係の無限のツリーになります:私は正常nodejsパッケージ、いくつかのアップデートがsudo apt-get updateと試みた後、本家を以下に示しているようnpmコマンドを認識しませんubuntu 15.10まだ私のオペレーティングシステムがインストールされています。それを修正するための解決策はありますか?

これは任意の助けになるだろう場合は、ここに私のsources.listです:

############################################################# 
################### OFFICIAL UBUNTU REPOS ################### 
############################################################# 

###### Ubuntu Main Repos 
deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse 

###### Ubuntu Update Repos 
deb http://us.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse 

###### Ubuntu Partner Repo 
deb http://archive.canonical.com/ubuntu precise partner 
deb-src http://archive.canonical.com/ubuntu precise partner 

###### Ubuntu Extras Repo 
deb http://extras.ubuntu.com/ubuntu precise main 
deb-src http://extras.ubuntu.com/ubuntu precise main 

事前に多くのおかげで。

+0

でそれを取得するには、https://github.com/creationix/nvm –

+0

をNVMする試みを与えるあなたはしようとする場合がありますhttp://askubuntu.com/これはプログラミングについてのことではなく、プログラムの環境をセットアップすることについてのことです(もちろんUbuntuです)。 –

+0

Ubuntu reposのnodejを使用せず、代わりにここからインストールしてください。https://github.com/nodesource/distributions#installation-instructions –

答えて

0

apt-getの代わりにaptitudeを使用します。それはより知的です。それは、あなたのために競合するパッケージをダウングレードするだけでなく、あなたが望む多くの可能な提案された作業シナリオのどれかを尋ねる一連の勧告を行います。

sudo aptitude install myNewPackage 

あなたはまだあなたのマシン上の適性を持っていない場合は、

sudo apt-get install aptitude 
関連する問題