今年我很幸运能在树下得到一台Raspberry Pi,在设备上玩Node.js时我感到很开心。但是,当您可以拉出软件包并将其插入应用程序时,Node.js会更有趣-这就是我遇到麻烦的地方。
如果我尝试使用以下命令将NPM与Node.js一起安装:
sudo apt-get install nodejs npm
我收到以下错误:
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.
我对软件包管理如何与基于Debian的Linux操作系统一起使用还很陌生,并且对node.js社区如何构建其特定软件包一无所知。值得注意的是,单独安装node.js可以正常工作,如果我尝试单独安装NPM,这就是我得到的。
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.
我不确定,但是我的直觉告诉我这与node-semver
包装有关。如果我自己安装nodejs
软件包,然后尝试安装,则node-semver
这是我得到的输出。
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.
有指针吗?