Netlify site name: kimchinese
Full build error log:
7:51:26 AM: Build ready to start
7:51:28 AM: build-image version: d2c6dbeac570350a387d832f64bc980dc964ad65 (focal)
7:51:28 AM: build-image tag: v4.8.0
7:51:28 AM: buildbot version: e58b6be665675c0f99b33132a8c1eec1f775eba1
7:51:28 AM: Fetching cached dependencies
7:51:28 AM: Failed to fetch cache, continuing with build
7:51:28 AM: Starting to prepare the repo for build
7:51:29 AM: No cached dependencies found. Cloning fresh repo
7:51:29 AM: git clone GitHub - jugheadjones10/kimchinese
7:51:30 AM: Preparing Git Reference refs/heads/main
7:51:31 AM: Parsing package.json dependencies
7:51:31 AM: Different build dir detected, going to use the one specified in the Netlify configuration file: āpackages/frontendā versus āā in the Netlify UI
7:51:31 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: āpackages/frontendā versus āā in the Netlify UI
7:51:31 AM: Different functions path detected, going to use the one specified in the Netlify configuration file: āpackages/frontend/netlify/functionsā versus āā in the Netlify UI
7:51:32 AM: Starting build script
7:51:32 AM: Installing dependencies
7:51:32 AM: Python version set to 2.7
7:51:32 AM: v16.14.2 is already installed.
7:51:33 AM: Now using node v16.14.2 (npm v8.5.0)
7:51:33 AM: Started restoring cached build plugins
7:51:33 AM: Finished restoring cached build plugins
7:51:33 AM: Attempting ruby version 2.7.2, read from environment
7:51:34 AM: Using ruby version 2.7.2
7:51:34 AM: Using PHP version 8.0
7:51:35 AM: No npm workspaces detected
7:51:35 AM: Started restoring cached node modules
7:51:35 AM: Finished restoring cached node modules
7:51:35 AM: Installing NPM modules using NPM version 8.5.0
7:51:35 AM: npm ERR! code ENOWORKSPACES
7:51:35 AM: npm ERR! This command does not support workspaces.
7:51:35 AM: npm ERR! A complete log of this run can be found in:
7:51:35 AM: npm ERR! /opt/buildhome/.npm/_logs/2022-04-24T22_51_35_768Z-debug-0.log
7:52:04 AM: npm ERR! Cannot set properties of null (setting ādevā)
7:52:04 AM: npm ERR! A complete log of this run can be found in:
7:52:04 AM: npm ERR! /opt/buildhome/.npm/_logs/2022-04-24T22_51_36_051Z-debug-0.log
7:52:04 AM: Error during NPM install
7:52:04 AM: Creating deploy upload records
7:52:04 AM: Build was terminated: Build script returned non-zero exit code: 1
7:52:05 AM: Failing build: Failed to build site
7:52:05 AM: Failed during stage ābuilding siteā: Build script returned non-zero exit code: 1 (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
7:52:05 AM: Finished processing build request in 36.901166292s
Explanation:
Hi, Iām trying to deploy the front end package that is within my monorepo to Netlify. Iām following the general recommendations laid out by Netlify, which is to include a netlify.toml file that specifies a base directory to the front end package in my monorepo. My netlify.toml looks like this:
[build]
base = āpackages/frontend/ā
This netlify.toml is at the root of my monorepo, and the individual packages in the monorepo all contain package.jsons that specify their own dependencies. Iām using npm workspaces to manage my monorepo.
The weird thing about this error is that when I run netlify build or netlify dev on my local machine, everything works fine. The build log seems to say that Iām doing something wrong regarding workspaces, but I canāt figure out what.
Addendum:
There was some strange behavior by netlify dev which might or might not be relevant. Even though I specified a base directory, netlify dev seemed to look for a ābuildā command in my root package.json instead of the package.json inside the front end package. I had to manually specify a npm build command in the root package.json that linked to the frontend packageās build command in order to get things working.
Thanks!