尝试在ubuntu12.04上安装nodejs和npm。我在谷歌上搜索并做了。现在,我无法在机器上安装npm。
sudo apt-get install npm这给了我这个
The following packages have unmet dependencies:
npm : Depends: nodejs but it is not going to be installed
Depends: nodejs-dev
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.发布于 2014-05-13 13:38:29
我通过跟踪这份文件解决了这个问题。
记住与国家预防机制合作的指针:
mkdir ~/nodejs/ && cd ~/nodejs
sudo apt-get install npm
npm install
npm update在开发应用程序时,如果nodejs需要任何特定模块,则运行
cd ~/nodejs
npm install modulename #for example sendgrid有时,模块需要全局安装,然后使用
sudo npm install modulename -g"要删除模块:
cd ~/nodejs
npm uninstall modulename # if locally installed or
sudo npm uninstall modulename -g # if globally installednpm prune帮助移除未满足的依赖项。
发布于 2014-05-07 14:04:42
看起来,您可能安装了克里斯node.js ppa,这很好。但是,您没有从ppa中安装npm,因为它破坏了debian包的工作方式。相反,只需安装nodejs即可。安装好之后,运行npm -v,您应该会看到它现在已经安装了。如果你没有使用chris更新你的问题,在你搜索的网页上找到如何在Ubuntu上安装nodejs。
发布于 2015-11-30 18:28:11
尝试像这样安装NodeJs:
sudo apt-get install nodejs自从NodeJs安装节点和npm以来
https://askubuntu.com/questions/462337
复制相似问题