Ho avuto la fortuna di avere un Raspberry Pi sotto l'albero quest'anno e mi sono divertito un po 'a giocare con Node.js sul dispositivo. Tuttavia, Node.js è molto più interessante quando puoi scaricare i pacchetti e collegarli alle tue applicazioni - ed è qui che ho qualche problema.
Se provo a installare NPM insieme a Node.js con il seguente comando:
sudo apt-get install nodejs npm
Ottengo il seguente errore:
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.
Sono abbastanza nuovo su come funziona la gestione dei pacchetti con i sistemi operativi Linux basati su Debian e non so molto su come la comunità node.js ha strutturato i loro pacchetti specifici. Vale la pena notare che l'installazione di node.js da sola funziona bene, e se provo a installare NPM da solo questo è quello che ottengo.
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.
Non ne sono sicuro, ma il mio istinto mi sta dicendo che ha a che fare con il node-semver
pacchetto. Se installo il nodejs
pacchetto da solo e quindi node-semver
provo a installare questo è l'output che ottengo.
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.
Qualche puntatore?