npm安装jsreport失败

时间:2016-03-22 20:35:21

标签: node.js ubuntu npm

我不确定这里应该责备什么。是npm有问题还是特定包被破坏了?

我正在尝试在Azure Ubuntu VM上安装JSReport,并遵循此处的简单说明(http://jsreport.net/downloads/)。但是,当我运行sudo npm install jsreport --production时,我从npm得到了这个错误:

npm http GET https://registry.npmjs.org/sntp
npm http 304 https://registry.npmjs.org/boom
npm http 304 https://registry.npmjs.org/sntp
npm http 304 https://registry.npmjs.org/hoek
npm http 304 https://registry.npmjs.org/cryptiles
npm WARN engine boom@2.10.1: wanted: {"node":">=0.10.40"} (current: {"node":"v0.10.25","npm":"1.3.10"})
npm WARN engine hoek@2.16.3: wanted: {"node":">=0.10.40"} (current: {"node":"v0.10.25","npm":"1.3.10"})
npm WARN engine cryptiles@2.0.5: wanted: {"node":">=0.10.40"} (current: {"node":"v0.10.25","npm":"1.3.10"})
npm http GET https://registry.npmjs.org/weak-map/1.0.0
npm http 304 https://registry.npmjs.org/weak-map/1.0.0
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/<username>/npm-debug.log
npm ERR! not ok code 0

当然......当我寻找/home/<username>/npm-debug.log时,根本就没有文件。我现在尝试删除node_modules两次并重试没有任何运气。有什么想法吗?

2 个答案:

答案 0 :(得分:1)

您需要升级您的节点版本。看来你现在已经安装了v0.10.25,但有些软件包需要/至少需要v0.10.40。就节点v0.10分支而言,v0.10.43是撰写本文时的最新版本。最新的节点LTS版本是v4.4.0,最新的稳定节点版本是v5.9.0。

答案 1 :(得分:0)

使用更新的jsreport ubuntu安装指南扩展正确的@mscdex答案:https://github.com/jsreport/docs/blob/master/installation/ubuntu.md

  

官方ubuntu apt-get发行版包含过时的node.js.一世   我更喜欢使用nvm来管理我的node.js安装。

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
     

如果您使用像putty这样的终端,则无法管道安装   到bash,所以你需要将它保存到文件并运行它。之后你   需要重新打开终端。

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh > install.sh
chmod +x install.sh
./install.sh
     

现在安装node.js

nvm install 5
     

为了能够运行npm或节点,你还需要运行   以下命令

n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local

之后你应该可以运行

sudo npm install jsreport --production
相关问题