Specify a custom node version?


#1

Is there a way to specify node 7? Looking at the logs I see node v6.10.1, npm 3.10.10 but my code uses node 7 features.

My package.json has:

"engines": {
    "node": "7.9.0"
  },

…which is good enough for e.g. heroku but it didn’t seem to work on Glitch.


#2

Yes, we have at least the following Node 7 versions available:
7.7.3 7.6.0 7.5.0 7.4.0 7.3.0 7.2.1 7.1.0 7.0.0
Specify one in your package.json:
"engines": { "node": "7.7.3" }


#3

Ah, glitch has 7.8 but not 7.9. I naively assumed it would have the latest release but I was mistaken.

Thanks!


#4

Also you can say

"engines": { "node": "7.x" },

and you’ll get the latest Glitch has. (It’s a standard Node feature to be able to specify versions that way, not just a Glitch feature, so that should work in Heroku too. [UPDATE: I confirmed it works in Heroku.])

PS: Node now recommends 6.10.2 LTS but looks like Glitch only has 6.10.1 currently.


#5

I just got caught out by this too, as I tried to use 7.9.x. Ideally it should error & say which versions are available.


#6

If anyone else is looking… I threw together a quick instance which will show the currently available node versions based on NVM (on that instance at least).

https://nodeversions.glitch.me/


#7

In my error log:

Could not find node 7.x, using 6.13.1

I’m kinda new to this, but when I read the documentation it doesn’t seem like "engines": { "node": "7.x" } is a valid format for the value.

There is a valid format for the value that doesn’t seem to work on Glitch:

"engines": {
  "node": ">=7.6"
}

I get the same type of error message:

Could not find node >= 7.6, using 6.13.1

(7.6 was the first version shipped with official support for async / await)


#8

We don’t support 7.x anymore. You can use 8.x or 9.x to get a newer version.