Syed Asad Abbas Zaidi
Syed Asad Abbas Zaidi

Reputation: 1066

Heroku: Update Node Version not working

I want to update my app node version deployed to Heroku Currently it is 0.10.40 on Heroku app

To change to my desired version I mainpulated the package.json file as:

{
  "name": "myapp",
  "private": true,
  "engines": {
    "node": "4.8.4"
  },
  "scripts": {
    "start": "meteor run"
  },
  "dependencies": {
    "meteor-node-stubs": "~0.2.0"
  }
}

And then deployed my code to heroku app. But still while checking the version through heroku CLI

heroku run node -v -a myapp

the version is not updated and it is still using the older one.

Any help !

Upvotes: 1

Views: 1834

Answers (2)

Niraj Kumar
Niraj Kumar

Reputation: 179

for a windows user: First Uninstall the previous nodejs from Program Files then download and install latest node https://nodejs.org/en/

Upvotes: 0

ghybs
ghybs

Reputation: 53185

  1. You should build your Meteor project to use it in production, instead of relying on the same meteor run command that you use for development. You can also find details on the Meteor Guide for Deployment.
  2. In the case of Heroku host, you can instead take advantage of a buildpack to automatically perform this build step on Heroku side, and avoid having to "commit" your build output. For Meteor, you can use AdmitHub/meteor-buildpack-horse for example. Note that you will not be able to manually change the Node version yourself. It is automatically set by the Meteor version you are using in your project.
  3. Still, by specifying the "engines" field in your package.json file and letting Heroku use your Meteor project as a Node.js app, it should have adjusted the Node version accordingly. But there are several potential mistakes that might explain why it is not. E.g. the new version of your package.json file not being properly committed, etc. Your current question does not share enough details to tell more about what could be the exact reason.

Upvotes: 4

Related Questions