Tag: heroku

node.js createWriteStream不会在Heroku上创build新文件

我有我的本地主机上运行node.js 0.12.0正常工作的以下代码。 代码创build一个新文件,并从可读的数据中复制数据,但不会在Heroku上创build新文件。 var output = fs.createWriteStream('public/images/test/testfile.png'); readable.pipe(output); 我认为这与权限有关,但每当我使用heroku run bash更改文件夹的权限,然后chmod -R 777 images/ Heroku将其重置为其原始权限,即drwx—— 。 所以可能是这个问题是别的? 请注意,它失败了,没有例外,没有任何logging。

平均应用程序deplouy到heroku错误

我正在尝试将一个node.js应用程序部署到heroku。 一切似乎都很好,直到我试图通过与Heroku的应用程序打开 heroku open 我然后得到 Opening nameless-taiga-6317… done 但是我的浏览器出现了应用程序错误,而且heroku日志吐出了这个消息: ←[36m2015-06-29T20:56:25.562616+00:00 heroku[web.1]:←[0m Process exited with status 1 ←[36m2015-06-29T20:56:27.685099+00:00 heroku[web.1]:←[0m Starting process with command `npm start` ←[36m2015-06-29T20:56:29.513842+00:00 app[web.1]:←[0m Detected 512 MB available memory, 512 MB limit per process (WEB_MEMORY) ←[36m2015-06-29T20:56:29.513866+00:00 app[web.1]:←[0m Recommending WEB_CONCURRENCY=1 ←[36m2015-06-29T20:56:30.256436+00:00 app[web.1]:←[0m npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start" ←[36m2015-06-29T20:56:30.257127+00:00 app[web.1]:←[0m npm ERR! npm v2.11.2 […]

Redis云在节点heroku应用程序中的会话

我有一个快速的应用程序,它使用Redis云来存储Heroku中的会话。 几个月前它工作的很好,但我刚刚重新访问它,它不再工作。 看来没有会话,并引发错误TypeError: Cannot read property 'user' of undefined ,违规的代码行是 if (!req.session.user) { … … } 也许我正在configuration的东西不正确 var session = require('express-session'); var RedisStore = require('connect-redis')(session); var redis = require('redis-url').connect(config.redis_url); var sessionMiddleware = session({ store: new RedisStore({ host: config.redis_host, port: config.redis_port }), secret: 'Its a secret.', cookie: { secure: true }, saveUninitialized: true, resave: true }); […]

一个git仓库中的多个模块; 只有一个模块需要部署到Heroku

我有一个项目,目前有2个npm模块。 一个模块将在Heroku上运行,而另一个模块将运行在客户端上。 这两个模块都是用Node编写的。 现在,他们在不同的回购协议,但我想把他们在同一个回购。 他们是彼此独立的,但devise为彼此交互,所以我想他们在同一个回购,因为他们是同一个项目的组成部分。 问题是Heroku推动回购中gitignore文件不会忽略的所有内容,但是我不希望客户端模块只能放在服务器上。 有没有办法告诉Heroku,我只想要一个npm模块部署,而不是其他? 也许与Git子模块或其他方式?

错误:ENOENT,stat'/app/public/views/index.html'在Heroku中

我在Heroku应用程序中提供静态视图的错误。 奇怪的是,Heroku似乎在我的静态文件path的前面附加了“app”,我不知道为什么。 path应该是“public / views / index.html”。 我最近尝试了这个来自Stack的build议解决scheme,但它似乎没有工作: Node.js,无法打开文件。 错误:ENOENT,stat'./path/to/file' 从我的服务器获取请求: app.use(express.static(__dirname + '/public')); app.get('/', function (req, res) { res.sendFile(__dirname + '/public/views/index.html'); }); // profile page app.get('/profile', function (req, res) { // check for current (logged-in) user req.currentUser(function (err, user) { // show profile if logged-in user if (user) { res.sendFile(__dirname + '/public/views/profile.html'); // redirect […]

尝试合并节点中的pdf文件:PDFUnite + Nodejs

我有一个关于heroku的网站,我正在使用HyPDF插件,它允许您以多种方式操纵pdf。 具体来说,我正在试图合并两个我有URL的PDF。 但是,它不工作。 我正在使用请求来拉取PDF文件,然后使用请求来调用PDFUnite。 这也是一个callback地狱,所以如果你有任何关于如何解决这个问题的build议,我会非常感激! 谢谢! request({url: 'http://www.sesamestreet.org/cms_services/services?action=download&uid=4010e80d-9106-4824-95ab-799ec81c7fd0', encoding: null}, function(err, res, body) { var pdf1 = body; request({url: 'http://www.sesamestreet.org/cms_services/services?action=download&uid=28a388c6-ca0e-45a1-9aaf-9b6688c5a557', encoding: null}, function(err2, res2, body2){ var pdf2 = body2; request.post( 'https://www.hypdf.com/htmltopdf', { json: { user: HY_USER, password: HY_PASS, file_1: pdf1, file_2: pdf2 } }, function (error3, res3, body3) { if (!error && res2.statusCode == 200) […]

ReferenceError:进程没有定义,Node,Heroku

我正在尝试在Node / Express应用程序中调用Heroku环境variables。 我使用Heroku中的envvariables heroku config:set GITHUB_TOKEN=<my github api token without quotation marks> 它设置正确(我通过运行herokuconfiguration检查) gitUserSearchController.js: githubUserSearch.controller('GitUserSearchController', ['$resource', function($resource) { var self = this; var searchResource = $resource('https://api.github.com/search/users/'); var githubToken=process.env.GITHUB_TOKEN; self.doSearch = function() { self.searchResult = searchResource.get( { q: self.searchTerm, access_token: githubToken } ); }; }]); 我从第5行得到一个控制台错误读出“参考错误:进程没有定义”。

如何使heroku停止创build一个只有工作人员的应用程序的Web进程?

我有一个简单的工作人员的应用程序,使用heroku的调度程序每天运行一次。 但是我注意到每次我推送代码并追踪到heroku创build一个web进程,运行我的worker命令(两次!),然后在我的worker完成后声明它“崩溃”,我得到了额外的运行。 我的Procfile只有一个条目: worker: npm start 但是当我推送到heroku,日志包括这一点: —–> Discovering process types Procfile declares types -> worker Default types for Node.js -> web 这里发生了什么,如何禁用它? 您可以在https://github.com/nfriedly/vzw-bot查看我的完整代码,并从最近的推送日志中查看: https : //travis-ci.org/nfriedly/vzw-bot/builds/83548651

如何使用“console.log”在NodeJS中使用命令行“Local heroku”在“Mac Terminal”中显示多行?

要启动我的应用程序, 当我使用命令行:“node index.js”=>我的Macterminal显示一个对象的所有行。 当我使用命令行:“heroku local”=>我的Macterminal只显示一个对象的一行。 当我使用“heroku本地”时,如何在Macterminal上显示多行? 谢谢

应用程序错误部署Node.js应用程序到Heroku

我是Github项目部署到Heroku的新手。 到目前为止,我已经成功地将我的应用程序连接到Heroku并进行了部署。 该项目在我的本地机器上运行良好。 但是,当我尝试启动我的应用程序的heroku网站时,它给了我这个错误: “应用程序发生错误,您的页面无法投放,请稍后重试。 如果您是应用程序所有者,请查看日志以获取详细信息。“ 这是我的英雄日志,我很难理解。 2015-11-10T04:33:10.538175+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=compasss.herokuapp.com request_id=af3a9061-1b8f-47fe-9e2e-eafa624f2712 fwd="138.110.234.184" dyno= connect= service= status=503 bytes= 2015-11-10T04:33:10.649481+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=compasss.herokuapp.com request_id=e8fc1b43-f629-4e38-85c9-808d731e852e fwd="138.110.234.184" dyno= connect= service= status=503 bytes= 2015-11-10T04:33:11.334843+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=compasss.herokuapp.com request_id=149ffc6c-8a57-475c-9f64-5224bcf72bfd fwd="138.110.234.184" dyno= connect= service= status=503 bytes= […]