user18172936
user18172936

Reputation: 21

I have problem with deploying Sanity studio on Netlify

it maybe silly questions to someone here but I have nowhere to ask so I came here. I deployed my portfolio page with Sanity & Gatsby Starter. It works okay → https://lovethis.one. deploy status The website is deployed perfectly but Studio keeps failing when I try to deploy.

On netlify it says it's failing because

$ npm run build-studio && cp studio/netlify.toml studio/dist
12:52:01 AM: > [email protected] build-studio
12:52:01 AM: > (cd studio && npm run build)
12:52:01 AM: > [email protected] build
12:52:01 AM: > sanity build
12:52:01 AM: sh: 1: sanity: not found
12:52:01 AM: ​
12:52:01 AM: ────────────────────────────────────────────────────────────────
12:52:01 AM:   "build.command" failed                                        
12:52:01 AM: ────────────────────────────────────────────────────────────────
12:52:01 AM: ​
12:52:01 AM:   Error message
12:52:01 AM:   Command failed with exit code 127: npm run build-studio && cp studio/netlify.toml studio/dist
12:52:01 AM: ​
12:52:01 AM:   Error location
12:52:01 AM:   In Build command from Netlify app:
12:52:01 AM:   npm run build-studio && cp studio/netlify.toml studio/dist
12:52:01 AM: ​
12:52:01 AM:   Resolved config
12:52:01 AM:   build:
12:52:01 AM:     base: /opt/build/repo
12:52:01 AM:     command: npm run build-studio && cp studio/netlify.toml studio/dist
12:52:01 AM:     commandOrigin: ui
12:52:01 AM:     environment:
12:52:01 AM:       - INCOMING_HOOK_BODY
12:52:01 AM:       - INCOMING_HOOK_TITLE
12:52:01 AM:       - INCOMING_HOOK_URL
12:52:01 AM:     publish: /opt/build/repo/studio/dist
12:52:01 AM:     publishOrigin: ui

I am quite newbie here and hope I can find answer. Also I am wondering why my studio shows the blank area like this. blank area on dashboard On the content side, it the name of the project is sample project I also wish to change. sample project not project Thank you in advance for your help! If I broke any rules here, I will try to edit or fix the content. Thank you for understanding.

Upvotes: 2

Views: 1071

Answers (1)

Geoff Ball
Geoff Ball

Reputation: 773

It looks like the Sanity CLI isn't installed so when the script tries to run the sanity build command, it fails. Could you run npm install @sanity/cli (note—not globally) in your studio folder, then try pushing/deploying once again?

Upvotes: 0

Related Questions