Meteor & Rocket.Chat 遇到的坑&解决(一)

3,075 阅读3分钟
        因为公司需要做一个即时聊天类型的功能,又想快速出产品,所以我们选定了基于Meteor的开源平台Rocket.Chat,然后就步入了我的踩坑之旅!

       踩坑指南第一步之Meteor安装:

curl https://install.meteor.com | sh

         官网大佬就跑出来一句话,嗯安装吧!安装的时候你就会发现你遇到的坑emmm!访问不到一直在报错(已经挂了梯子,也有可能是梯子的坑!)

Failed to connect to install.meteor.com port 443: Connection timed out. 

试过很多种方法,最后找到一个国内的源:

curl https://coding.net/u/wwulfric/p/meteor-install/git/raw/master/install.sh | sh

经过短暂的几分钟,emmm,安装成功!

根据w3cshcool上来创建一个项目玩玩吧 !地址

meteor create microscope
cd microscope
meteor //npm run 

能跑成功!我以为的成功来一大步,实际后面还会有坑!去Git 上clone  Rocket.Chat 代码,npm install,报错

gyp: No Xcode or CLT version detected!

百度后发现是Xcode 问题,找到解决方法:(Mac升级到High sierra 后,发现执行使用npm 或者yarn 的时候,不时会报gyp: No Xcode or CLT version detected! 的错误, 原因是缺了xcode 的CLI 工具, 只要执行下面的命令来安装就可以了。)

sudo xcode-select --install

看到报错:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

解决办法(如果有权限问题加 sudo)

$ rm -rf /Library/Developer/CommandLineTools
$ xcode-select --install

再删除Rocket.Chat/node_modules,执行

rm -rf /node_modules
npm i

回看到依赖安装成功,启动项目

npm start 

第二坑之 meteor-tool 安装

本以为安装完了就好了,但是跑了1%的进度的meteor-tool  又回到0% ,我的心再滴血(网络原因,所以才导致meteor-tool下载慢,或者反复重新下载)

找到网上的解决方案1.修改hosts文件

54.192.225.217 warehouse.meteor.com 

重启后报错

Sorry, Meteor 1.9.2 is not installed and could not be downloaded. Please check
to make sure that you are online.

所以此方法不可行。。。。;

找到原因终端没有加代理的原因。。。。。

export http_proxy="http://127.0.0.1:1087"
export https_proxy="http://127.0.0.1:1087"

我这里使用的是shadowxxxxxx,其他可根据自己软件进行设置代理(这个配置只会影响当前的终端),测试自己终端是否已经代理成功:

curl cip.cc


成功后执行:

meteor 

会看到 meteor-tool@1.9.2正常下载,可能需要等待一段时间,如果出现一下类似内容:

While downloading check@1.3.1...:
error: Client network socket disconnected before secure TLS connection wasestablished

推出后检查代理是否中断,执行:

curl cip.cc


成功后执行:

meteor 

直到所有东西安装成功,可能会提醒大家npm update,退出后/Rocket.Chat目录下执行npm update (这里 我执行yarn,因为执行npm update 持续又依赖报报错,但是执行yarn 后没有报错)


成功执行:

meteor //npm start

等待一段时间后看到:

访问:http://localhost:3000/ 就会看到 Rocket.Chat项目

所以这里最开始安装的meteor 是否可以在代理下直接安装,我么有尝试,尝试过的同学可以回复下如果可以就不需要访问使用国内的源;

一个小白的踩坑指南!!!!!!奥利给,踩坑之路才刚刚开始!

相关连接:

Rocket.Chat,Meteor