Thanks for the response and the link, SamO.
Project repo: Pull requests · thekevinscott/UpscalerJS · GitHub
If your build works locally, the next debugging step is to ensure the package versions we use to build match the ones you use in your own development environment. You can find the settings for these in our Build Settings doc. That’s the leading cause of build failures.
I’m pretty sure that the package manager is different, as the logs above indicate Netlify is using npm
, and it should be using pnpm
. I don’t see anything in the linked documentation that discusses pnpm
, and I’m not sure where else that workspace:*
error in the logs would be coming from.
I’ve read through the rest of the documentation and can’t seem to find anything that matches the error I’m seeing.
I reran the build with debug mode on. Here’s the logs:
7:29:23 PM: build-image version: a2d22d22e4555d1ef0a972ed14a0a4b366ad20c4 (focal)
7:29:23 PM: build-image tag: v4.16.3
7:29:23 PM: buildbot version: 3bd65547ad0cc7e555b4d091bb1e3da5ef545973
7:29:23 PM: Fetching cached dependencies
7:29:23 PM: Starting to download cache of 1.5GB
7:29:39 PM: Finished downloading cache in 15.78378204s
7:29:39 PM: Starting to extract cache
7:29:51 PM: Finished extracting cache in 11.296960307s
7:29:51 PM: Finished fetching cache in 27.232094429s
7:29:51 PM: Starting to prepare the repo for build
7:29:51 PM: Preparing Git Reference refs/heads/main
7:29:52 PM: Parsing package.json dependencies
7:29:53 PM:
❯ Initial build environment
baseRelDir: true
branch: main
context: production
cwd: /opt/build/repo
featureFlags: []
mode: buildbot
repositoryRoot: /opt/build/repo
siteId: 9d17b951-1726-4bb0-b2f1-c21b69b0dd00
❯ UI build settings
baseRelDir: true
build:
base: docs
command: pnpm run build
environment:
- NETLIFY_BUILD_DEBUG
publish: build
❯ Resolved build environment
branch: main
buildDir: /opt/build/repo/docs
configPath: /opt/build/repo/netlify.toml
context: production
env: []
❯ Resolved config
build:
base: /opt/build/repo/docs
command: pnpm run build
commandOrigin: config
environment:
- NETLIFY_BUILD_DEBUG
ignore: git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF .
publish: /opt/build/repo/docs/build
publishOrigin: config
7:29:53 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'docs/build' versus 'build' in the Netlify UI
7:29:53 PM: Detected ignore command in Netlify configuration file. Proceeding with the specified command: 'git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF .'
7:29:54 PM: Failed to get framework information, continuing with build
7:29:54 PM: Starting build script
7:29:54 PM: Installing dependencies
7:29:54 PM: Python version set to 2.7
7:29:54 PM: Started restoring cached Node.js version
7:29:55 PM: Finished restoring cached Node.js version
7:29:55 PM: v16.19.0 is already installed.
7:29:56 PM: Now using node v16.19.0 (npm v8.19.3)
7:29:56 PM: Enabling Node.js Corepack
7:29:56 PM: Started restoring cached build plugins
7:29:56 PM: Finished restoring cached build plugins
7:29:56 PM: Attempting Ruby version 2.7.2, read from environment
7:29:57 PM: Using Ruby version 2.7.2
7:29:57 PM: Using PHP version 8.0
7:29:57 PM: Started restoring cached corepack dependencies
7:29:57 PM: mv: cannot move '/opt/build/cache/.node/corepack' to '/opt/buildhome/.node/corepack': No such file or directory
7:29:57 PM: Finished restoring cached corepack dependencies
7:29:57 PM: jq: error (at <stdin>:1): Cannot iterate over null (null)
7:29:57 PM: No npm workspaces detected
7:29:57 PM: Started restoring cached node modules
7:29:57 PM: Finished restoring cached node modules
7:29:57 PM: Bypassing sha validation. Running pre & post install scripts
7:29:57 PM: Installing npm packages using npm version 8.19.3
7:30:00 PM: npm ERR! code EUNSUPPORTEDPROTOCOL
7:30:00 PM: npm ERR! Unsupported URL Type "workspace:": workspace:*
7:30:00 PM: npm ERR! A complete log of this run can be found in:
7:30:00 PM: npm ERR! /opt/buildhome/.npm/_logs/2023-01-18T00_29_58_111Z-debug-0.log
7:30:00 PM: Error during npm install
7:30:00 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
7:30:00 PM: Build was terminated: Build script returned non-zero exit code: 1
7:30:00 PM: Failing build: Failed to build site
7:30:00 PM: Finished processing build request in 37.087281569s
The line Error during npm install
certainly seems to indicate that npm
is being used, despite the presence of a pnpm-lock.yaml
file.