简体   繁体   English

Bower-相同的Bower版本,相同的bower.json,无法在其他计算机上运行(不同的nodejs版本)

[英]Bower - same bower version, same bower.json, not working on different machine (diff. nodejs version)

Update: this is now solved - just install the node-legacy package. 更新:现在已解决-只需安装node-legacy软件包。 This can also solve problems installing npm modules, eg websocket, which report This failure might be due to the use of legacy binary "node" . 这也可以解决安装npm模块(例如websocket)的问题,该模块报告This failure might be due to the use of legacy binary "node"

I'm following a procedure to install an app from github. 我正在遵循从github安装应用程序的过程。 I can get it working on my machine, but not on a VPS, using identical commands. 我可以使用相同的命令使其在我的机器上运行,但不能在VPS上运行。

The first step, downloading the repo, works on both machines: 第一步,下载仓库,可以在两台机器上工作:

git clone git://github.com/jsonchess/lightsquare.git

The next step is to cd into the downloaded repo and do bower install to get the dependencies: 下一步是cd进入下载的仓库并进行bower install以获取依赖项:

cd lightsquare - obviously the same effect on both machines. cd lightsquare两台机器上的效果明显相同。

Just to be sure I compared the bower.json files at this point: 为了确保在这一点上我比较了bower.json文件:

md5sum bower.json
edea21a5e088824a11f039c4694fa230  bower.json

md5sum bower.json
edea21a5e088824a11f039c4694fa230  bower.json

bower install works fine on my machine: bower install在我的机器上工作正常:

$ bower install
bower websocket-client#*    not-cached git://github.com/gushogg-blake/websocket-client.git#*
bower websocket-client#*       resolve git://github.com/gushogg-blake/websocket-client.git#*

... some output omitted for clarity ...
... no errors ...

jsonchess#78f1b23027 bower_components/jsonchess

chess#a5729e7d8a bower_components/chess

But on the VPS bower install outputs nothing (straight back to the prompt), as does bower --version : 但是在VPS bower install输出任何内容(直接返回到提示符),与bower --version

$ bower install
$ bower --version

$ bower --version outputs 1.3.9 on my machine. $ bower --version在我的机器上输出1.3.9

So to compare the commands I ran, on my machine: 因此,为了比较我在计算机上运行的命令:

gus@mint lightsquare$ which bower
/usr/local/bin/bower
gus@mint lightsquare$ md5sum /usr/local/bin/bower 
018425bfa8540b0e2a3dd55480db1cf6  /usr/local/bin/bower
gus@mint lightsquare$ 

... and on the vps: ...在VPS上:

gus@jsonchess:~/projects/lightsquare$ which bower 
/usr/local/bin/bower
gus@jsonchess:~/projects/lightsquare$ md5sum /usr/local/bin/bower 
018425bfa8540b0e2a3dd55480db1cf6  /usr/local/bin/bower
gus@jsonchess:~/projects/lightsquare$ 

Obviously the bower command is the same on both machines, and it's a NodeJS program, so the only thing I can think of is some difference in the NodeJS versions. 显然,bower命令在两台计算机上都是相同的,并且它是一个NodeJS程序,因此,我唯一能想到的就是NodeJS版本中的某些区别。 My machine is running v0.10.15 and the VPS is running v0.10.25 . 我的机器正在运行v0.10.15 ,而VPS正在运行v0.10.25

Still though, I would expect some kind of error, not just silence from any bower command. 尽管如此,我还是希望会出现某种错误,而不仅仅是任何Bower命令保持沉默。 Any ideas what this could be? 有什么想法吗?

Installing the node-legacy package, which provides the node command, solved this. 安装提供了node命令的node-legacy软件包即可解决此问题。 I believe an alternative solution would be to simply symlink /usr/bin/node to /usr/bin/nodejs . 我相信一种替代解决方案将是简单地将/usr/bin/node链接到/usr/bin/nodejs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM