Miałem szczęście, że w tym roku udało mi się zdobyć Raspberry Pi pod drzewem i świetnie się bawiłem grając w Node.js na urządzeniu. Jednak Node.js jest o wiele bardziej interesujący, gdy możesz pobrać pakiety i podłączyć je do swoich aplikacji - i tutaj mam pewne problemy.
Jeśli spróbuję zainstalować NPM wraz z Node.js za pomocą następującego polecenia:
sudo apt-get install nodejs npm
Otrzymuję następujący błąd:
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.
Jestem całkiem nowy, jak działa zarządzanie pakietami w systemach operacyjnych Linux opartych na Debianie i nie wiem zbyt wiele o tym, jak społeczność node.js zorganizowała swoje konkretne pakiety. Warto zauważyć, że sama instalacja node.js działa dobrze, a jeśli spróbuję zainstalować NPM sama, otrzymam to.
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.
Nie jestem pewien, ale moje wnętrzności mówią mi, że to ma coś wspólnego z node-semver
paczką. Jeśli sam zainstaluję nodejs
pakiet, a następnie spróbuję go zainstalować node-semver
, otrzymam wynik.
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.
Jakieś wskazówki?