Tag: heroku

在heroku服务器上的幽灵博客的密码authentication失败

我正在尝试设置Ghost(node.js博客应用程序)在Heroku服务器上运行。 我在这里按照这个教程,但是当我加载应用程序的URL时,我得到一个应用程序错误。 看日志,我得到以下堆栈跟踪: 2016-12-16T10:00:08.185701+00:00 heroku[web.1]: Starting process with command `NODE_ENV=production node index.js` 2016-12-16T10:00:11.989635+00:00 app[web.1]: 2016-12-16T10:00:11.989655+00:00 app[web.1]: ERROR: password authentication failed for user "xxxxxxxxxxxxxx" 2016-12-16T10:00:11.989656+00:00 app[web.1]: error: password authentication failed for user "xxxxxxxxxxxxxx" 2016-12-16T10:00:11.989656+00:00 app[web.1]: 2016-12-16T10:00:11.989658+00:00 app[web.1]: at Connection.parseMessage (/app/node_modules/pg/lib/connection.js:361:17) 2016-12-16T10:00:11.989657+00:00 app[web.1]: at Connection.parseE (/app/node_modules/pg/lib/connection.js:534:11) 2016-12-16T10:00:11.989659+00:00 app[web.1]: at TLSSocket.<anonymous> (/app/node_modules/pg/lib/connection.js:105:22) 2016-12-16T10:00:11.989660+00:00 app[web.1]: at emitOne (events.js:96:13) 2016-12-16T10:00:11.989661+00:00 […]

对于模型“Coach”,投射到ObjectId的path“_id”的值“”失败

我的应用程序在本地工作,但在生产中我似乎无法使用mongoose从mongo获取特定的东西。 我试过了: var Coach = mongoose.model('Coach', CoachSchema); Coach.findOne({ _id: req.session.userId}, function (err, coach) {}) Coach.find({ _id:req.session.userId}, function (err, coach) {}) Coach.findById(req.session.userId).exec(function(err, coach)){}) 我收到了同样的错误: Cast to ObjectId failed for value "586bc06bd09d870012baa5b8" at path "_id" for model "Coach" 就像我说的,它与本地nodemon和heroku local但在我的heroku生产服务器不起作用。 我在这里读了一下这种types的转换错误: 什么是Mongoose错误对于path“_id”中的值XXX,转换为ObjectId失败? Mongoose拒绝将有效的string转换为ObjectId 对于模型“User”,投射到ObjectId的path“_id”的值“586cc8b3ea780c071bbe2469”失败 但没有运气呢。 任何帮助将是伟大的。 先谢谢你。

在将nodejs部署到Heroku时抛出错误URL

我有一个node.js服务器在本地主机上成功运行。 但是当我部署到Heroku,服务器崩溃。 我检查本地和heroku有相同的node.js和npm版本。 希望收到你的build议。 谢谢。 这里是消息日志: 2017-01-13T04:16:32.949664+00:00 app[web.1]: > golaundryserver@1.0.0 start /app 2017-01-13T04:16:32.949665+00:00 app[web.1]: > node server.js 2017-01-13T04:16:32.949665+00:00 app[web.1]: 2017-01-13T04:16:33.344617+00:00 app[web.1]: url.js:87 2017-01-13T04:16:33.344629+00:00 app[web.1]: throw new TypeError('Parameter "url" must be a string, not ' + typeof url); 2017-01-13T04:16:33.344630+00:00 app[web.1]: ^ 2017-01-13T04:16:33.344631+00:00 app[web.1]: 2017-01-13T04:16:33.344633+00:00 app[web.1]: TypeError: Parameter "url" must be a string, not undefined 2017-01-13T04:16:33.344634+00:00 app[web.1]: […]

Heroku应用程序没有使用正确的节点模块

我试图在我的Heroku应用程序上testing一个节点模块的分支。 以下是我所做的: 分叉节点模块回购,并对代码进行了一些更改。 推到我自己的远程回购。 在我的Heroku bashterminal上运行以下内容: npm install git+https://git@github.com/Nsrose/node_model_updated.git 冉heroku重新启动。 这实际上更新了我在node_modules /文件夹下编辑的文件。 但是,此文件更改修复的错误不会更改。 在npm安装之前,应用程序说这个错误: 错误TypeError:无法读取未定义的属性“通道”(第97行) 在上述一系列命令之后,即使文件在node_modules /下的heroku服务器上更新,错误依然存在。 实际上,我现在改变的文件甚至没有任何与97行上的“频道”有关的东西。 为什么我的heroku应用仍在使用旧的node_module /以及如何强制更新?

Heroku,Node,Express,SSL的ERR_SSL_PROTOCOL_ERROR

我最近为我Heroku托pipe的网站wildcodemonkey.com启用了SSL,但是当我在Chrome中访问它时,看到错误“ERR_SSL_PROTOCOL_ERROR”。 我的研究表明,SSL连接终止于Heroku的路由器,然后通过HTTP将请求传递到我的express / node站点。 因此,我没有在我的服务器上设置“https”,并期待标准的HTTP连接。 我的SSLconfiguration是这样的,我的CSR,关键和证书传递给Heroku。 我正在使用Heroku中的SSL选项,而不是第三方资源/插件。 在我的应用程序的设置中启用SSL后,我更改了DNS以反映新端点(wildcodemonkey.com.herokudns.com而不是wildcodemonkey.com.herokuapp.com),这是我在Heroku上configurationSSL时要使用的端点,设置好ssl后直接从设置页面复制粘贴。 我看到摩根loggingGET请求,当我打到域,所以它看起来像所有事情都结束了,所以我不知道问题发生在哪里。 任何援助将不胜感激。 提前感谢。

无法将nodejs应用程序部署到heroku

我正在尝试将一个nodejs应用程序部署到heroku,当我检查heroku logs时出现以下错误, sh:1:npm-run-all:找不到 我的package.json看起来像这样 { "name": "web-training", "version": "1.0.0", "description": "web-training", "scripts": { "prestart": "babel-node tools/startMessage.js", "start": "npm-run-all –parallel open:src lint:watch test:watch", "open:src": "babel-node tools/srcServer.js", "lint": "node_modules/.bin/esw webpack.config.* src tools", "lint:watch": "npm run lint — –watch", "test": "mocha –reporter spec tools/testSetup.js \"src/**/*.test.js\"", "test:watch": "npm run test — –watch", "clean-dist": "npm run remove-dist && mkdirp dist-server/dist", […]

如何在Heroku上使用Selenium Webdriver?

我正在开发一个Node.js应用程序,我使用Selenium Webdriver进行刮取。 但是,当我在Heroku上部署时,Selenium不起作用。 我如何让Selenium在Heroku上工作?

Heroku:节点应用程序抛出的错误“没有默认的语言可以检测到这个应用程序”

我正在学习NodeJS,我正在学习的课程有几个项目,按部分安排。 我有一个主文件夹下的所有项目,这也是一个Git仓库 。 主文件夹中的每个子文件夹都是一个节点项目,在node_modules包含package.json和相关的依赖关系。 问题是,当我试图将节点应用程序在一个这样的文件夹( todo-api )推向heroku,我得到以下错误 – remote: Compressing source files… done. remote: Building source: remote: remote: ! No default language could be detected for this app. remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically. remote: See https://devcenter.heroku.com/articles/buildpacks remote: remote: ! Push failed remote: Verifying deploy… […]

运行gitlab-ci.yml时,只有在合并请求发送给master时

我目前正在GitLab和Heroku中进行项目。 我想要做的是只要我要求我的function分支的合并请求(我们称之为crud-on-spaghetti ),我想自动运行在这个分支上的testing( npm test基本上,使用Mocha / Chai),以及成功之后,把这个crud-on-spaghetti和master合并,把它提交给origin/master (在GitLab上是远程的),然后在git push heroku master Heroku git push heroku master (基本上把他推到Heroku的主分店,应用程序被存储)。 我已经阅读了几篇关于GitLab CI的文章,我认为这更适合我(而不是Heroku CI,因为我没有DEV和PROD实例)。 所以,到现在为止,我手动做这个。 这是我的.gitlab-ci.yml文件( .gitlab-ci.yml没有被提交/推送): stages: – test – deploy test_for_illegal_bugs: stage: test script: – npm test deploy_to_dev: stage: deploy only: – origin master script: – git commit – git push origin master – git pull heroku […]

Heroku上的PhantomJSpath

我有一个在Heroku上运行的节点应用程序。 我在python中使用selenium来抓取一个网站,并在我需要的时候从我的节点app调用python脚本。 我在我的Mac上安装PhantomJS,当我在本地运行应用程序(节点index.js)时,一切正常。 path_to_phantom = '/Users/govind/Desktop/phantomjs-2.1.1- macosx/bin/phantomjs' browser = webdriver.PhantomJS(executable_path = path_to_phantom) 然而,Heroku似乎没有任何工作。 我也将PhantomJS buildpack添加到我的节点应用程序,但它只是不会调用python脚本。 我认为这个问题是通往PhantomJS buildpack的path。 我应该添加什么path? 还是有我在这里失踪的其他方面?