Error when deploying a website on Cloudflare Pages

Error arises during build stage on Cloudflare Pages. The website I am trying to deploy is made using astro-build. The same website is perfectly deployed on vercel. Not sure what the problem is in Cloudflare Pages case.

Build logs below

2022-07-21T11:07:01.51823Z	Cloning repository...
2022-07-21T11:07:02.91521Z	From https://github.com/bkyerv/astro-build
2022-07-21T11:07:02.91573Z	 * branch            6a2fd2b0f36143a1576e6da40fec572e81334e4b -> FETCH_HEAD
2022-07-21T11:07:02.915924Z	
2022-07-21T11:07:02.961122Z	HEAD is now at 6a2fd2b replaced fetched data with dummy data
2022-07-21T11:07:02.961661Z	
2022-07-21T11:07:03.110113Z	
2022-07-21T11:07:03.139675Z	Success: Finished cloning repository files
2022-07-21T11:07:03.756581Z	Installing dependencies
2022-07-21T11:07:03.769248Z	Python version set to 2.7
2022-07-21T11:07:07.23319Z	v12.18.0 is already installed.
2022-07-21T11:07:08.415794Z	Now using node v12.18.0 (npm v6.14.4)
2022-07-21T11:07:08.655779Z	Started restoring cached build plugins
2022-07-21T11:07:08.670942Z	Finished restoring cached build plugins
2022-07-21T11:07:09.17348Z	Attempting ruby version 2.7.1, read from environment
2022-07-21T11:07:12.884843Z	Using ruby version 2.7.1
2022-07-21T11:07:13.248898Z	Using PHP version 5.6
2022-07-21T11:07:13.409688Z	5.2 is already installed.
2022-07-21T11:07:13.434295Z	Using Swift version 5.2
2022-07-21T11:07:13.434859Z	Started restoring cached node modules
2022-07-21T11:07:13.449861Z	Finished restoring cached node modules
2022-07-21T11:07:13.685771Z	Installing NPM modules using NPM version 6.14.4
2022-07-21T11:07:14.660041Z	npm WARN read-shrinkwrap This version of npm is compatible with [email protected], but package-lock.json was generated for [email protected] I'll try to do my best with it!
2022-07-21T11:07:27.561231Z	
2022-07-21T11:07:27.561661Z	> [email protected] postinstall /opt/buildhome/repo/node_modules/esbuild
2022-07-21T11:07:27.562305Z	> node install.js
2022-07-21T11:07:27.562536Z	
2022-07-21T11:07:28.17686Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
2022-07-21T11:07:28.177287Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.17766Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-windows-64):
2022-07-21T11:07:28.177858Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.177998Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-windows-arm64):
2022-07-21T11:07:28.178124Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"win32","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.178248Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-windows-32):
2022-07-21T11:07:28.17836Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"win32","arch":"ia32"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.178475Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-openbsd-64):
2022-07-21T11:07:28.178601Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"openbsd","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.178742Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-sunos-64):
2022-07-21T11:07:28.178868Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"sunos","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.178981Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-netbsd-64):
2022-07-21T11:07:28.179096Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"netbsd","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.179205Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-linux-s390x):
2022-07-21T11:07:28.179364Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"s390x"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.179488Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-linux-riscv64):
2022-07-21T11:07:28.179615Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"riscv64"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.179737Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-linux-ppc64le):
2022-07-21T11:07:28.179863Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"ppc64"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.179978Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-linux-mips64le):
2022-07-21T11:07:28.180088Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"mips64el"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.180223Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-linux-arm64):
2022-07-21T11:07:28.180335Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.180447Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-linux-arm):
2022-07-21T11:07:28.180572Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"arm"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.180686Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-linux-32):
2022-07-21T11:07:28.180803Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"ia32"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.180978Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-freebsd-arm64):
2022-07-21T11:07:28.181094Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"freebsd","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.181219Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-android-arm64):
2022-07-21T11:07:28.181332Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"android","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.181444Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-freebsd-64):
2022-07-21T11:07:28.181566Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"freebsd","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.181685Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-android-64):
2022-07-21T11:07:28.181811Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"android","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.182752Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-darwin-arm64):
2022-07-21T11:07:28.182934Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.183103Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-darwin-64):
2022-07-21T11:07:28.18322Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-07-21T11:07:28.183782Z	
2022-07-21T11:07:28.186216Z	added 512 packages from 279 contributors and audited 532 packages in 13.564s
2022-07-21T11:07:28.377292Z	
2022-07-21T11:07:28.377661Z	229 packages are looking for funding
2022-07-21T11:07:28.377834Z	  run `npm fund` for details
2022-07-21T11:07:28.377971Z	
2022-07-21T11:07:28.378139Z	found 6 vulnerabilities (3 moderate, 2 high, 1 critical)
2022-07-21T11:07:28.378258Z	  run `npm audit fix` to fix them, or `npm audit` for details
2022-07-21T11:07:28.43405Z	NPM modules installed
2022-07-21T11:07:28.863033Z	Installing Hugo 0.54.0
2022-07-21T11:07:29.565916Z	Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
2022-07-21T11:07:29.570567Z	Started restoring cached go cache
2022-07-21T11:07:29.592735Z	Finished restoring cached go cache
2022-07-21T11:07:29.769335Z	go version go1.14.4 linux/amd64
2022-07-21T11:07:29.785264Z	go version go1.14.4 linux/amd64
2022-07-21T11:07:29.788181Z	Installing missing commands
2022-07-21T11:07:29.788594Z	Verify run directory
2022-07-21T11:07:29.788853Z	Executing user command: npm run build
2022-07-21T11:07:30.15666Z	
2022-07-21T11:07:30.157053Z	> @example/[email protected] build /opt/buildhome/repo
2022-07-21T11:07:30.157238Z	> astro build
2022-07-21T11:07:30.157376Z	
2022-07-21T11:07:30.245483Z	(node:1359) ExperimentalWarning: The ESM module loader is experimental.
2022-07-21T11:07:30.263408Z	
2022-07-21T11:07:30.263736Z	Node.js v12.18.0 is not supported by Astro!
2022-07-21T11:07:30.263911Z	Please upgrade to a version of Node.js with complete ESM support: "^14.15.0 || >=16.0.0"
2022-07-21T11:07:30.264045Z	
2022-07-21T11:07:30.269153Z	npm ERR! code ELIFECYCLE
2022-07-21T11:07:30.269462Z	npm ERR! errno 1
2022-07-21T11:07:30.270282Z	npm ERR! @example/[email protected] build: `astro build`
2022-07-21T11:07:30.270531Z	npm ERR! Exit status 1
2022-07-21T11:07:30.270774Z	npm ERR! 
2022-07-21T11:07:30.271011Z	npm ERR! Failed at the @example/[email protected] build script.
2022-07-21T11:07:30.27143Z	npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2022-07-21T11:07:30.280095Z	
2022-07-21T11:07:30.280408Z	npm ERR! A complete log of this run can be found in:
2022-07-21T11:07:30.28057Z	npm ERR!     /opt/buildhome/.npm/_logs/2022-07-21T11_07_30_274Z-debug.log
2022-07-21T11:07:30.289544Z	Failed: build command exited with code: 1
2022-07-21T11:07:31.080199Z	Failed: an internal error occurred

Unless you’re using 12.18.0 on Vercel too, your setup is different.

Make sure you’re setting a modern Node version by adding the NODE_VERSION environment variable into your Pages project.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.