Setting node v12

Hi!

I’ve been trying to set my environment to node v12, but can’t seem to get it to pick up. As a result, I’m getting failed builds.

My code is in this public repo: https://github.com/endymion1818/freeb5-gatsbyjs/pull/4

As you can see from recent commits in that branch, I’ve tried .nvmrc, netlify.toml and via the dashboard, but builds keep failing. I have CircleCI configuration too, but that has been updated and is now building fine.

Am I doing something wrong?

Hard to say since I’m not familiar with your source code. We are selecting the right version of node as you can see in the build log:

6:27:11 AM: Downloading https://nodejs.org/dist/v12.2.0/node-v12.2.0-linux-x64.tar.xz...

The problem is during build, (at least from the deploy 5d024f1a3838a9e9091decaa from yesterday at 6am Pacific time):

6:28:07 AM: error gatsby-node.js returned an error
6:28:07 AM: 
6:28:07 AM:   Error: Cannot find module '../actions.js'
6:28:07 AM:   Require stack:
6:28:07 AM:   - /opt/build/repo/node_modules/gatsby/dist/redux/actions/add-page-dependency.j  s
6:28:07 AM:   - /opt/build/repo/node_modules/gatsby/dist/schema/context.js
6:28:07 AM:   - /opt/build/repo/node_modules/gatsby/dist/redux/prepare-nodes.js
6:28:07 AM:   - /opt/build/repo/node_modules/gatsby/dist/redux/run-sift.js
6:28:07 AM:   - /opt/build/repo/node_modules/gatsby/dist/db/nodes-query.js
6:28:07 AM:   - /opt/build/repo/node_modules/gatsby/dist/db/nodes.js
6:28:07 AM:   - /opt/build/repo/node_modules/gatsby/dist/redux/actions/public.js
6:28:07 AM:   - /opt/build/repo/node_modules/gatsby/dist/redux/actions/index.js
6:28:07 AM:   - /opt/build/repo/node_modules/gatsby/dist/utils/webpack.config.js
6:28:07 AM:   - /opt/build/repo/node_modules/gatsby/dist/commands/build-html.js
6:28:07 AM:   - /opt/build/repo/node_modules/gatsby/dist/commands/build.js
6:28:07 AM:   - /opt/build/repo/node_modules/gatsby-cli/lib/create-cli.js
6:28:07 AM:   - /opt/build/repo/node_modules/gatsby-cli/lib/index.js

which you’d need to debug with our standard build debugging advice (in our container, using a fresh copy of your repo locally):

Aha how interesting. I think I assumed it was that since upgrading to v12 in CircleCI seemed to fix the issue.

Thanks for replying Chris, I’ll take a look at what else I might have done wrong …