我遵循这个要求https://gist.github.com/Goddard/5500157来安装nodejs和npm,但运行后,既不能运行节点–version或npm –version,也不能find命令错误。 我能卸载nodejs,但必须进入脚本中描述的临时目录,并做卸载让npm离开。
现在试图再次安装nodejs和npm我用这个链接,而不是http://www.andreagrandi.it/2013/02/08/how-to-install-latest-stable-node-js-on-ubuntu/ ,但如果我尝试和安装nodejs和npm在一起,我得到这个错误消息。
sudo apt-get install nodejs npm The following packages have unmet dependencies: nodejs : Conflicts: npm E: Unable to correct problems, you have held broken packages.
如果我只是安装nodejs工作正常。
sudo apt-get install nodejs node --version v0.10.15
但是现在如果我尝试安装npm,它会给我这个错误信息
sudo apt-get install npm The following packages have unmet dependencies: npm : Depends: nodejs (>= 0.6.19~dfsg1-3) but it is not going to be installed Depends: nodejs-dev Depends: node-node-uuid 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.
我正在使用Ubuntu 13.04。 任何帮助表示赞赏。 我不太了解node.js和npm。 我试图开始学习如何使用这些,所以可能我的经验显示。
您从PPA安装的nodejs软件包包含自v0.10.0以来的npm 。 既然你有v0.10.15,当你运行sudo apt-get install nodejs你也安装了npm 。 尝试运行npm来确认。
另请参阅官方的安装指南 (你所遵循的是它的一个副本,但官方的有一些额外的细节)。