Tag: heroku

是否有可能使Heroku与C ++ BSONparsing器一起安装mongodb NPM软件包?

在本地,我可以运行npm install –mongodb:native来获得npm来编译和安装C ++ BSONparsing器,但是我不能在Heroku上复制相同的操作。 我尝试添加一个预安装命令npm install mongodb –mongodb:native到package.json但npm在Heroku环境下的path上实际上并不可用。 查看mongodb包的源代码 ,看起来它正在寻找一个环境variables(由npm根据我猜想的命令行参数创build)。 也许有一种注入Heroku构build环境的方法? BSON(de)序列化正在成为我的应用程序的一大CPU +内存,而C ++parsing器有助于缓解这种情况。

Node.js worker内存尖峰使用request&pkgcloud时出现错误R14

这个让我感到莫名其妙,因为它看起来是随机的。 我有一个Node.js应用程序,它使用ntwitterstream式传输tweet,每秒向MongoDB添加数百行。 这部分总是工作正常,内存使用稳定。 但是最近我已经开始获取twitter头像的URL并将它们保存到我们的rackspace CDN(使用“request”和“pkgcloud”模块)。 我每20秒钟循环一次(但通常less一些),运行这个代码: request(idocs[ikey].tweet.user.profile_image_url.replace('_normal.', '_bigger.')).on('response', function(response) { console.log(response.request.path); avatars.push(path.basename(path.dirname(response.request.path)) + '/' + path.basename(response.request.path)); var headers = {}; if (response.headers && response.headers['content-type']) { headers['content-type'] = response.headers['content-type']; } if (response.headers && response.headers['content-length']) { headers['content-length'] = response.headers['content-length']; } response.headers = headers; }).pipe(client.upload({ container: process.env.RACKSPACE_CONTAINER, remote: path.basename(path.dirname(idocs[ikey].tweet.user.profile_image_url)) + '/' + path.basename(idocs[ikey].tweet.user.profile_image_url.replace('_normal.', '_bigger.')) })); 一切都可以正常工作,但是我在Nodetime中遇到了以下疯狂的问题: 这里是“heroku logs […]

Express 4.0中的Heroku socket.io示例错误

所以我试图使用示例heroku应用程序: https : //github.com/lstoll/socket-io-chat-heroku作为模板来build立我自己的socket.io应用程序,但我运行在Express 4.0,节点0.10.x和Socket.io 0.9.16。 现在的问题是,当我运行我的服务器,一切都很好,但是当我运行我的客户端,我得到以下错误: Uncaught ReferenceError: require is not defined socket.io.js:12 Uncaught ReferenceError: io is not defined chat2:2 我的相关服务器代码如下所示: var app = express(); var http = require('http'); var server = http.createServer(app); var sio = require('socket.io'); var port = 3000 || process.env.PORT; server.listen(port); var io = sio.listen(server); io.sockets.on('connection'), function(socket) { … }); 在我的客户端,我有以下几点:我已经尝试了两个(顺便说一下,这是玉器): […]

Heroku上的具体npm版本

我试图把我的Web应用程序在Heroku,但它需要一个特定的NPM版本(> 2.0,因为我想从本地path安装模块)。 我试图在我的package.json文件中指定npm版本,如下所示: "engines": { "node": "0.10.x", "npm": "2.1.6" }, 但它不起作用。 我得到以下内容: [13:26:09][Step 3/3] 80 http 200 https://registry.npmjs.org/mailgun [13:26:09][Step 3/3] 81 silly registry.get cb [ 200, [13:26:09][Step 3/3] 81 silly registry.get { date: 'Wed, 12 Nov 2014 18:26:08 GMT', [13:26:09][Step 3/3] 81 silly registry.get server: 'CouchDB/1.5.0 (Erlang OTP/R16B03)', [13:26:09][Step 3/3] 81 silly registry.get etag: '"4TEYXG8V5ESBTLTLYGNM1K3VM"', […]

PAAS上的PouchDb(Heroku,Bluemix等)

我从Stackoverflow得到了一些很好的反馈,并想检查一个更多的想法。 目前我已经有一个在PAAS上运行nodejs的Web应用程序(Heroku并尝试使用bluemix)。 服务器正在configuration为与Couchdb(托pipe在云中)通信。 有两种types的数据保存到数据库,第一,用户数据(每个用户将拥有自己的数据库),第二,应用程序数据本身(指标,用户帐户信息(授权/pipe理的东西)。 从这里得到一些很好的反馈意见后,他们的想法是,用户login后,他们会同步本地(浏览器)pouchdb实例与Cloudant(可能通过我的服务器代理,如这里推荐)。 现在的问题是,对于应用程序/pipe理数据,也许我在我的服务器上运行一个couchdb实例,所以我不会重复networking调用像用户login,度量数据等事情。数据不会很大,已经从用户数据调用中分离出来了。 重点是有一个更快/本地身份validation主要实例,更改/更新同步用户请求之外。 后端是在快速的web框架,它看起来像我的选项是pouchdb ….同步到Cloudant实例? 如果我希望本地数据库访问(支持Couchdb实例),在PAAS上运行的节点/快递服务器上,是build议的设置? 感谢vm的任何反馈,保罗

安装webpack不能在Heroku上运行

我使用Heroku来托pipe我的应用程序和webpack来构build它。 基本上,我试图部署我的应用程序,但它根本不工作。 后装似乎没有发生,因为当我加载页面时,它缺less文件bundle.js (这是通过webpack构build)。 这是我的package.json脚本: "main": "server.js", "scripts": { "dev": "webpack-dev-server –devtool eval –content-base build/ –colors –hot", "start": "node server.js", "postinstall": "webpack -p –config webpack.prod.config.js –progress" } 当我把我的项目推到heroku时,在这个过程中没有显示错误。 我可以在控制台中看到它正在运行我的postinstall: remote:> pistou@1.0.0 postinstall / tmp / build_80dea0f9774d7a9a5f8f33ee9c913bca remote:> webpack -p –config webpack.prod.config.js –progress 这是我的整个webpack.prod.config.js文件: var path = require('path'); var webpack = require('webpack'); var node_dir = path.resolve(__dirname, […]

通用反应渲染与CDN和heroku

尝试设置服务器端(通用,同构)呈现的反应应用程序,该应用程序通过CircleCI使用Heroku为node / express应用程序部署,Cloudfront作为CDN部署。 我有一些麻烦概念化这将如何工作。 stream量似乎非常简单,除了几个部分。 一旦我们将构build的资产部署到像CloudFront这样的CDN,我们如何将它们连接到位于Heroku上的index.html文件? (这个索引文件是由Heroku节点应用程序构build的,并作为服务器端渲染的基础)。 但我希望它包含CDN资产的链接,而不是Herokubuild立的资产。 (CircleCi运行webpack,一旦部署,Heroku也是如此) 有没有人遇到过这个?

Heroku Websocket(socket.io)'空闲连接'H15 – Node.JS

我不知道如何摆脱“空闲连接”错误。 它曾经更糟糕,但它仍然发生在我们每个左右。 这是我用Papertrail得到的日志: Aug 09 23:07:25 heroku/router: at=info method=GET path="/a/login/" host=… request_id=f99431f8-9ce9-4e1e-b16f-0ae2b50870ab fwd="74.210.150.28" dyno=web.1 connect=1ms service=258ms status=304 bytes=305 Aug 09 23:07:26 heroku/router: at=info method=GET path="/js/auth.js" host=app.sofiatutors.com request_id=12896c98-9803-4161-bf5b-06028123ff86 fwd="74.210.150.28" dyno=web.1 connect=2ms service=3ms status=304 bytes=240 Aug 09 23:07:56 heroku/router: at=info method=POST path="/api/email/reset/qEUsZwkRvp750OBgCFuXImiCWPhQbTD0vFVaGEyCZJJXEJGpm6Gi7cgKWsLqHOTusRHieWyVgEbqe6T5qH7wCJT9ROToeHnINhTDvq5unWT6r7fwh4ha59PlQVwB6TmS" host=app.sofiatutors.com request_id=ae44cd3d-cb06-42bd-8948-9e8ca8273ebe fwd="74.210.150.28" dyno=web.1 connect=1ms service=395ms status=200 bytes=426 Aug 09 23:08:11 heroku/router: at=info method=POST path="/api/email/reset/qEUsZwkRvp750OBgCFuXImiCWPhQbTD0vFVaGEyCZJJXEJGpm6Gi7cgKWsLqHOTusRHieWyVgEbqe6T5qH7wCJT9ROToeHnINhTDvq5unWT6r7fwh4ha59PlQVwB6TmS" […]

推向Heroku失败 – sinon-mongoose,grpc,node-pre-gyp

直到昨天我才能推到Heroku。 目前,我正在推我Heroku拒绝与以下错误消息: Installing node modules (yarn.lock) yarn install v1.3.2 [1/4] Resolving packages… [2/4] Fetching packages… [3/4] Linking dependencies… warning " > sinon-mongoose@1.3.0" has incorrect peer dependency "sinon@1". [4/4] Building fresh packages… error /tmp/build_592ecabd23ba493189b9cac8d/node_modules/multer-gcs/node_modules/grpc: Command failed. Exit code: 127 Command: ./node_modules/.bin/node-pre-gyp install –fallback-to-build Arguments: Directory: /tmp/build_592ecabd23ba493189b9cac8d/node_modules/multer-gcs/node_modules/grpc Output: /bin/sh: 1: ./node_modules/.bin/node-pre-gyp: not found info Visit https://yarnpkg.com/en/docs/cli/install for […]

将Node.js应用程序推送到Heroku时,如何跳过“使用npm安装依赖项”步骤?

当我做“git push heroku master”时,总是有一个步骤说“用npm安装依赖关系”。 然后它会加载并重新安装所有的依赖关系,即使它已经存在。 这是非常耗时的,我想在部署的时候跳过这个步骤,我知道依赖关系是相同的。 有没有这样的命令或选项?