Saya cukup beruntung mendapatkan Raspberry Pi di bawah pohon tahun ini dan saya bersenang-senang bermain dengan Node.js di perangkat. Namun, Node.js jauh lebih menarik ketika Anda dapat menarik turun paket dan menancapkannya ke aplikasi Anda - dan di sinilah saya mengalami masalah.
Jika saya mencoba menginstal NPM bersama dengan Node.js dengan perintah berikut:
sudo apt-get install nodejs npm
Saya mendapatkan kesalahan berikut:
pi@raspberrypi ~ $ sudo apt-get install nodejs 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:
nodejs : Breaks: npm (< 1.1.4~dfsg-2~) but 1.1.4~dfsg-1 is to be installed
npm : Depends: node-semver but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Saya cukup baru tentang bagaimana manajemen paket bekerja dengan sistem operasi Linux berbasis Debian dan tidak tahu banyak tentang bagaimana komunitas node.js telah menyusun paket-paket spesifik mereka. Perlu dicatat bahwa menginstal node.js dengan sendirinya berfungsi dengan baik, dan jika saya mencoba menginstal NPM dengan sendirinya ini adalah apa yang saya dapatkan.
pi@raspberrypi ~ $ 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 but it is not going to be installed
Depends: nodejs-dev but it is not going to be installed
Depends: node-request but it is not going to be installed
Depends: node-mkdirp but it is not going to be installed
Depends: node-minimatch but it is not going to be installed
Depends: node-semver but it is not going to be installed
Depends: node-ini but it is not going to be installed
Depends: node-graceful-fs but it is not going to be installed
Depends: node-abbrev but it is not going to be installed
Depends: node-nopt but it is not going to be installed
Depends: node-fstream but it is not going to be installed
Depends: node-rimraf but it is not going to be installed
Depends: node-tar but it is not going to be installed
Depends: node-which but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Saya tidak yakin, tetapi nyali saya mengatakan bahwa itu ada hubungannya dengan node-semver
paket. Jika saya menginstal nodejs
paket dengan sendirinya dan kemudian mencoba untuk menginstal node-semver
ini adalah output yang saya dapatkan.
pi@raspberrypi ~ $ sudo apt-get install node-semver
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:
node-semver : Depends: nodejs but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Ada petunjuk?