【发布时间】:2015-11-27 05:22:42
【问题描述】:
我已经从源代码正确安装了 node,js,我正在尝试安装 npm,但我收到的错误与方法无关。
我主要关注这个链接:Installing Node and Npm from source
如果我尝试克隆 npm 存储库并在继续 make install 后收到此错误消息:
scripts/doc-build.sh: line 58: ./node_modules/.bin/marked: No such file or directory
make: *** [html/doc/api/npm-uninstall.html] Error 1
如果我选择使用 sript(wget 或 curl)从源代码安装,则会出现以下错误(使用 http 或 https,没关系):
wget http://npmjs.org/install.sh
--2014-05-13 00:52:25-- http://npmjs.org/install.sh
Connecting to 127.0.0.1:8118... failed: Connection refused.
如果我尝试使用 curl,我会收到另一条错误消息:
curl https://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) couldn't connect to host
如果我尝试使用 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.
node -v
v0.11.14-pre
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.4 LTS
Release: 12.04
Codename: precise
which node
/home/user/local/node/node
我不知道我还能做些什么,因为这个问题我昨天到现在都遇到了一整天的麻烦。
感谢有人能帮我解决这个问题。
【问题讨论】:
-
你不只是 apt-get install npm 吗?