{
"$type": "site.standard.document",
"canonicalUrl": "https://www.simoncox.com/short-articles/2024-10-15-11ty-upgrading-node-in-netlify/",
"description": "Simon Cox fixes a failed 11ty build on Netlify by identifying a mismatch in Node versions, updating config settings and documenting the troubleshooting process.",
"path": "/short-articles/2024-10-15-11ty-upgrading-node-in-netlify/",
"publishedAt": "2024-10-15T11:45:29.798Z",
"site": "at://did:plc:tki7vwlanxbwrz2er67eaeqa/site.standard.publication/3mp4h4md7zv2y",
"tags": "Eleventy",
"textContent": "I upgraded the image plugin for 11ty on a small site which had an unintended chain of issues! \n\nI noticed that the Source control had node elements in it, even though I have node_modules in my gitignore file. After some investigation and testing I realised that I must have deployed the site before adding the gitignore. Really should not have node_modules deployed to the repository even though it is private.\n\nTo remove the node_modules from the repository I moved the folder up a level and committed and synced the files. That removed the node_modules from the repository. I then moved the node_modules folder back into the local site and ran a build - all was ok.\n\nI checked Netlify and the build had failed. \n\nIt turned out (i.e. head scratching and testing for a while) is wasn't my local Node but the Node version on Netlify that needed upgrading - of course it was. \n\nWith the node_modules in the build, Netlify had used the node_modules I had provided to create the build - which is a great feature but not what was needed. As soon as I had removed them Netlify used the default node_modules which failed to build because apparently node needed upgrading. \n\nOn the Netlify Site Configuration > Build & Deploy > Dependency management (scroll down) to find and configure the Netlify version of Node - it was 15 and I apparently needed 18, so set to 20. Bingo - built and deployed magnificently!\n\nI hope this note helps someone but it is really for me the next time I get this issue on another site and don't realise I fixed it before.",
"title": "11ty upgrading node in netlify"
}