Tuve la suerte de obtener una Raspberry Pi debajo del árbol este año y me he divertido un poco jugando con Node.js en el dispositivo. Sin embargo, Node.js es mucho más interesante cuando puede desplegar paquetes y conectarlos a sus aplicaciones, y aquí es donde tengo algunos problemas.
Si intento instalar NPM junto con Node.js con el siguiente comando:
sudo apt-get install nodejs npm
Obtuve el siguiente error:
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.
Soy bastante nuevo en cómo funciona la administración de paquetes con los sistemas operativos Linux basados en Debian y no sé mucho acerca de cómo la comunidad node.js ha estructurado sus paquetes específicos. Vale la pena señalar que la instalación de node.js en sí misma funciona bien, y si trato de instalar NPM solo, esto es lo que obtengo.
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.
No estoy seguro, pero mi instinto me dice que tiene algo que ver con el node-semver
paquete. Si instalo el nodejs
paquete solo y luego intento instalarlo, node-semver
este es el resultado que obtengo.
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.
¿Algún puntero?