1

Can anyone tell us how to change the node version used to run a zapier app to node 6.10.2 or later?

Zapier cli docs state that All Zapier CLI apps are run using Node.js v6.10.2.. Our app is built using the cli.

Elsewhere in Zapier docs it states that The environment is vanilla node.js v4.3.2 which runs JavaScript.

We already did z.console.log('node version', process.version); from within the Zapier app so that we can see the node version where it is run. We retrieved this using zapier logs. The version logged is 4.3.2.

Previously our package.json contained:

json
"engines": {
    "node": ">=4.3.2",
    "npm": ">=2.0.0"
  }

We have updated this to:

json
  "engines": {
    "node": "6.10.2",
    "npm": ">=2.0.0"
  }

The same applies for the travis.yml which was previously 4.3.2 but is now: yml node_js: - "6.10.2"

Thanks ; )

SOLUTION

As noted in the accepted answer below, zapier cli apps are currently run with node 6.10.x. We changed the node version in our package.json under the engine key to be 6.10.2, but this alone did not change the node version it was run with. The node version was updated when we changed the zapier-platform-core dependency to be 4.3.1 (it was previously 1.x), and logging process.version now shows the version as 6.10.3.

2 Answers2

1

The zapier App does not run in your machine. It only gets built and validated via 'zapier validate' and each time you do 'zapier push'. You only run the optional tests in your machine. So, when CLI checks your app, it runs node 6.10.2 and this is why you need this in your machine. Once your app is uploaded, you do not really care where it runs, but they say it is node 4.3.2

JohnPan
  • 1,185
  • 11
  • 21
  • Thanks, we know that the zapier app does not run locally - it is run remotely wherever zapier hosts it. Our issue is the version of node that is used when it is run remotely. Do you mean that when it runs remotely is always uses 4.3.2? And 6.10.2 is just what is used for building the app locally before pushing? We interpreted the reference to 6.10.2 (see link) to mean that it was run remotely using 6.10.2. Link: https://github.com/zapier/zapier-platform-cli#requirements – Bart Bucknill Jan 12 '18 at 15:08
  • Alright, I guess that clears it up then. To my understanding the syntax has run in node version 4.3.2 : ( Thanks! – Bart Bucknill Jan 12 '18 at 15:19
0

David here, from the Zapier Platform team. Just wanted to clear up some confusion here.

We've got 2 separate platforms, both of which are run in Lambda. Currently, they run different versions of Node.js. The Web Builder runs 4.3.2 and the CLI runs 6.10.2. You can read more about the differences here.

To answer your question, there's no mechanism to have a Web Builder app run Node 6 right now, but we'll need to move them all at some point.

I'll see what I can do about making that distinction more clear in the docs. Sorry for the confusion!

xavdid
  • 5,092
  • 3
  • 20
  • 32
  • David, that's good to know, thanks. We are using the cli for our app but the version running it is 4.3.2 (logged), any idea why this might be the case and how I could change it? I'm building on work started by someone else, it might be possible that they started the app using the Web Builder, not the cli. If I just generated a new cli app and copied the code over would that get me into a lambda running 6.10.2? – Bart Bucknill Jan 13 '18 at 20:41
  • We used to have CLI on node 4, so if it's an old app it could still be on the old version. I *believe* this is controlled by the `engine` key in the `package.json`, but i'm not sure. If you write into prtners@zapier.com with your app id, we can take a closer look! – xavdid Jan 13 '18 at 23:10
  • I've update the question with a solution above - the trick was changing the zapier-platform-core version. – Bart Bucknill Jan 15 '18 at 22:04