Error Cannot find the root of your workspace

Currently i want to deploy Ghost with Netlify (with GitHub as a repository), but i found this detail error that NPM can not found the root at my workspace.

If you have any reference or input, i’m here to listen.

Please help me.

Thank you.

7:27:25 PM: Section completed: initializing
7:27:26 PM: ​
7:27:26 PM: Netlify Build
7:27:26 PM: ────────────────────────────────────────────────────────────────
7:27:26 PM: ​
7:27:26 PM: ❯ Version
7:27:26 PM: @netlify/build 29.9.0
7:27:26 PM: ​
7:27:26 PM: ❯ Flags
7:27:26 PM: baseRelDir: true
7:27:26 PM: buildId: 6426d1516771f21bd524f90f
7:27:26 PM: deployId: 6426d1516771f21bd524f911
7:27:26 PM: ​
7:27:26 PM: ❯ Current directory
7:27:26 PM: /opt/build/repo/current
7:27:26 PM: ​
7:27:26 PM: ❯ Config file
7:27:26 PM: No config file was defined: using default values.
7:27:26 PM: ​
7:27:26 PM: ❯ Context
7:27:26 PM: production
7:27:26 PM: ​
7:27:26 PM: 1. Build command from Netlify app
7:27:26 PM: ────────────────────────────────────────────────────────────────
7:27:26 PM: ​
7:27:26 PM: $ CI= npm run build
7:27:26 PM: > ghost@5.37.0 build
7:27:26 PM: > npm pack --pack-destination …/…
7:27:27 PM: > ghost@5.37.0 prepack
7:27:27 PM: > yarn workspace ghost-admin run build:prod && yarn build:css && npx --yes daniellockyer/monobundle
7:27:27 PM: yarn workspace v1.22.19
7:27:27 PM: error Cannot find the root of your workspace - are you sure you’re currently in a workspace?
info Visit yarn workspace | Yarn for documentation about this command.
7:27:27 PM: npm ERR! code 1
7:27:27 PM: npm ERR! path /opt/build/repo/current
7:27:27 PM: npm ERR! command failed
7:27:27 PM: npm ERR! command sh -c – yarn workspace ghost-admin run build:prod && yarn build:css && npx --yes daniellockyer/monobundle
7:27:27 PM: npm ERR! A complete log of this run can be found in:
7:27:27 PM: npm ERR! /opt/buildhome/.npm/_logs/2023-03-31T12_27_26_994Z-debug-0.log
7:27:27 PM: ​
7:27:27 PM: “build.command” failed
7:27:27 PM: ────────────────────────────────────────────────────────────────
7:27:27 PM: ​
7:27:27 PM: Error message
7:27:27 PM: Command failed with exit code 1: CI= npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
7:27:27 PM: ​
7:27:27 PM: Error location
7:27:27 PM: In Build command from Netlify app:
7:27:27 PM: CI= npm run build
7:27:27 PM: ​
7:27:27 PM: Resolved config
7:27:27 PM: build:
7:27:27 PM: base: /opt/build/repo/current
7:27:27 PM: command: CI= npm run build
7:27:27 PM: commandOrigin: ui
7:27:27 PM: environment:
7:27:27 PM: - CI
7:27:27 PM: publish: /opt/build/repo/current/build
7:27:27 PM: publishOrigin: ui
7:27:27 PM: Caching artifacts
7:27:27 PM: Started saving node modules
7:27:27 PM: Finished saving node modules
7:27:27 PM: Started saving build plugins
7:27:27 PM: Finished saving build plugins
7:27:27 PM: Started saving corepack cache
7:27:27 PM: Finished saving corepack cache
7:27:27 PM: Started saving yarn cache
7:27:35 PM: Finished saving yarn cache
7:27:35 PM: Started saving pip cache
7:27:35 PM: Finished saving pip cache
7:27:35 PM: Started saving emacs cask dependencies
7:27:35 PM: Finished saving emacs cask dependencies
7:27:35 PM: Started saving maven dependencies
7:27:35 PM: Finished saving maven dependencies
7:27:35 PM: Started saving boot dependencies
7:27:35 PM: Finished saving boot dependencies
7:27:35 PM: Started saving rust rustup cache
7:27:35 PM: Finished saving rust rustup cache
7:27:35 PM: Started saving go dependencies
7:27:35 PM: Finished saving go dependencies
7:27:35 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:27:35 PM: Failing build: Failed to build site
7:27:35 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
7:27:36 PM: Finished processing build request in 1m38.51s

Hi,

What are your build settings? Can you check that you are in the correct directory. Can you confirm you ran the command npm install or yarn install in your root directory?

Here is my build setting configuration

for commans is “npm run build”

Are you able to share the repository you are deploying from?

hi, thank you for your advise, is there any references? i already gave my command and build settings configuration

The current error seems very different from what you’ve shared:

  1. Build command from Netlify app                             
3:54:10 PM: ────────────────────────────────────────────────────────────────
3:54:10 PM: ​
3:54:10 PM: $ npm install --legacy-peer-deps && npm run build
3:54:17 PM: npm ERR! code ETARGET
3:54:17 PM: npm ERR! notarget No matching version found for @tryghost/email-content-generator@0.0.0.
3:54:17 PM: npm ERR! notarget In most cases you or one of your dependencies are requesting
3:54:17 PM: npm ERR! notarget a package version that doesn't exist.
3:54:17 PM: npm ERR! A complete log of this run can be found in:
3:54:17 PM: npm ERR!     /opt/buildhome/.npm/_logs/2023-04-07T10_24_10_384Z-debug-0.log

have you managed to get past the first mentioned error?