简体   繁体   English

Heroku停留在Node v0.10.30上(但是package.json要求提供当前版本)

[英]Heroku stuck at Node v0.10.30 (but package.json asks for current version)

Specify correct Node version.. 指定正确的节点版本。

"engines": {
    "node": "6.5.0",
    "npm": "3.10.3"
  },
  "scripts": {
    "postinstall": "node_modules/gulp/bin/gulp.js buildProd",
    "start": "node server.js -p $PORT"
  }

When deploying, the following log is shown.. 部署时,显示以下日志。

-----> Installing binaries
remote:        engines.node (package.json):  6.5.0
remote:        engines.npm (package.json):   3.10.3

So Heroku appears to be picking up on the engine field of package.json and installing the correct version. 因此,Heroku似乎正在package.jsonengine字段上安装了正确的版本。

But when checking Node version on Heroku... 但是在Heroku上检查Node版本时...

heroku run bash
node -v
v0.10.30

I get the wrong version 我得到了错误的版本

Are you using the Ruby Buildpack along with Node.js? 您是否正在将Ruby Buildpack与Node.js一起使用? Ruby requires node for certain parts of a build pipeline, and it installs 0.10.30 by default if node doesn't exist. Ruby在构建管道的某些部分需要节点,如果节点不存在,则默认安装0.10.30。 To fix that, just put the Node.js Buildpack ahead of the Ruby buildpack, so node exists when the Ruby Buildpack runs. 要解决此问题,只需将Node.js Buildpack放在Ruby buildpack的前面,这样当Ruby Buildpack运行时该节点就存在。

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

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