Tive a sorte de conseguir um Raspberry Pi debaixo da árvore este ano e me diverti um pouco brincando com o Node.js no dispositivo. No entanto, o Node.js é muito mais interessante quando você pode extrair pacotes e conectá-los aos seus aplicativos - e é aqui que estou tendo alguns problemas.
Se eu tentar instalar o NPM junto com o Node.js com o seguinte comando:
sudo apt-get install nodejs npm
Estou tendo o erro a seguir:
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.
Eu sou muito novo em como o gerenciamento de pacotes funciona com sistemas operacionais Linux baseados no Debian e não sei muito sobre como a comunidade node.js. estruturou seus pacotes específicos. Vale a pena notar que a instalação do node.js por si só funciona muito bem, e se eu tentar instalar o NPM por si só, é isso que recebo.
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.
Não tenho certeza, mas meu intestino está me dizendo que isso tem algo a ver com o node-semver
pacote. Se eu instalar o nodejs
pacote por si só e tentar instalar, node-semver
essa é a saída que eu recebo.
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.
Alguma dica?