npm的哪个版本适用于NodeJS 0.10?

4
我正在按照指南http://cartodb.readthedocs.org/en/latest/install.html安装CartoDD。 它需要nodejs 0.10才能工作。 指南中指定了以下内容:
sudo add-apt-repository ppa:cartodb/nodejs-010 && sudo apt-get update
sudo apt-get install nodejs 
sudo apt-get install npm

安装Node.js 0.10成功,但在尝试安装npm时出现以下错误消息:

~$ 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
       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.

我认为与nodejs同时安装的是一个npm安装程序:

~$ npm -v
1.4.3

这是适用于NodeJS 0.10的正确npm版本吗?我不确定它是否已经存在。这个apt-cache输出更加令人担忧,因为它表明npm未安装,但我刚刚执行了它。
~$ apt-cache policy npm
npm:
  Installed: (none)
  Candidate: 1.1.4~dfsg-1
  Version table:
     1.1.4~dfsg-1 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages

还有一些让我怀疑这个安装有问题的事情。 npm install 大体上运行良好,但在安装MAPS API时,我遇到了以下错误:

Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
gyp: Call to './util/has_cairo_freetype.sh' returned exit status 0.
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.13.0-32-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/raquel/Windshaft-cartodb/node_modules/windshaft/node_modules/canvas
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 
npm http GET https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz
npm http GET https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz
npm http 200 https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz
npm http 200 https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz
npm http GET https://github.com/CartoDB/carto/archive/master.tar.gz
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/home/raquel/Windshaft-cartodb/node_modules/windshaft/node_modules/carto/node_modules/mapnik-reference'
npm ERR! error rolling back  windshaft@0.51.0 { [Error: ENOTEMPTY, rmdir '/home/raquel/Windshaft-cartodb/node_modules/windshaft/node_modules/carto/node_modules/mapnik-reference']
npm ERR! error rolling back   errno: 53,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   path: '/home/raquel/Windshaft-cartodb/node_modules/windshaft/node_modules/carto/node_modules/mapnik-reference' }
npm ERR! canvas@1.2.7-cdb1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the canvas@1.2.7-cdb1 install script.
npm ERR! This is most likely a problem with the canvas package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls canvas
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.13.0-32-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/raquel/Windshaft-cartodb
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE

如果我使用 sudo apt-get install libpango1.0-dev 命令并再次用 npm install 重新安装,就可以解决那个错误。但是我不确定这是否只是一个临时方案,并且我之前没有安装正确的 npm 版本,可能做错了什么。

1个回答

11

以下是完整的列表(v0.10.0 - v0.10.40):

  • node v0.10.0 -> npm v1.2.14
  • node v0.10.1 -> npm v1.2.15
  • node v0.10.2 -> npm v1.2.15
  • node v0.10.3 -> npm v1.2.17
  • node v0.10.4 -> npm v1.2.18
  • node v0.10.5 -> npm v1.2.18
  • node v0.10.6 -> npm v1.2.18
  • node v0.10.7 -> npm v1.2.21
  • node v0.10.8 -> npm v1.2.23
  • node v0.10.9 -> npm v1.2.24
  • node v0.10.10 -> npm v1.2.25
  • node v0.10.11 -> npm v1.2.30
  • node v0.10.12 -> npm v1.2.32
  • node v0.10.13 -> npm v1.3.2
  • node v0.10.14 -> npm v1.3.5
  • node v0.10.15 -> npm v1.3.5
  • node v0.10.16 -> npm v1.3.8
  • node v0.10.17 -> npm v1.3.8
  • node v0.10.18 -> npm v1.3.8
  • node v0.10.19 -> npm v1.3.11
  • node v0.10.20 -> npm v1.3.11
  • node v0.10.21 -> npm v1.3.11
  • node v0.10.22 -> npm v1.3.14
  • node v0.10.23 -> npm v1.3.17
  • node v0.10.24 -> npm v1.3.21
  • node v0.10.25 -> npm v1.3.24
  • node v0.10.26 -> npm v1.4.3
  • node v0.10.27 -> npm v1.4.8
  • node v0.10.28 -> npm v1.4.9
  • node v0.10.29 -> npm v1.4.14
  • node v0.10.30 -> npm v1.4.21
  • node v0.10.31 -> npm v1.4.23
  • node v0.10.32 -> npm v1.4.28
  • node v0.10.33 -> npm v1.4.28
  • node v0.10.34 -> npm v1.4.28
  • node v0.10.35 -> npm v1.4.28
  • node v0.10.36 -> npm v1.4.28
  • node v0.10.37 -> npm v1.4.28
  • node v0.10.38 -> npm v1.4.28
  • node v0.10.39 -> npm v1.4.28
  • node v0.10.40 -> npm v1.4.28
  • 我建议您使用 nnvwm,这样您就不必担心版本问题。


    非常感谢您的回答!我也在想...您这个列表是从哪里得到的? - zapatilla
    1
    哈哈,我早就预料到了。首先,我浏览了发布说明,但花费的时间比我想象的要长。所以,我只是安装了所有的node.js版本,并检查了它们的npm版本。然后使用“n rm 0.10.*”命令删除了所有的node.js版本。 - Gökay Gürcan
    1
    @GökayGürcan 你知道我们可以在哪里找到官方的依赖关系图表吗?感谢。我问这个问题是因为虽然“n”是一个很好的开发工具,但在持续集成方面,人们希望锁定版本以减少意外和获得更可复制的构建结果。 - AlexanderF
    3
    这是一张将 Node 发布版本与对应的 npm 版本进行映射的表格。您可以在以下链接中查看:https://nodejs.org/en/download/releases/ - giraffe.guru

    网页内容由stack overflow 提供, 点击上面的
    可以查看英文原文,
    原文链接