Netlify Deploy Command failed with exit code 254: npm run build-studio && cp studio/netlify.toml studio/dist

Hi @ericerodgers

a) Not sure why you are copying the netlify.toml into dist.
b) The netlify.toml in studio is incorrectly formatted.
It reads

CI= npm run build

when it should read

[build]
  command = "CI= npm run build"

I still see it in the project root as well as in studio which also contains a yarn.lock.

I was able to build your code locally without error.

I have forked your repository, removed package-lock.json, yarn.lock, netlify.toml files and as with you, tried various values to get it to build.

In the end, I managed to get it to build.

These are the build settings I used:

Notice I set the Base directory to studio. npm run build then runs the build command in the package.json in that directory. Speaking of which, I modified that, removing the lerna bootstrap. Lastly I added the environment variable NPM_FLAGS with the value --force as there is a dependency issue with the sanity version as you can see in build log agitated-kowalevski-2cc360/deploys/613dbba3ed232afb2b2fb3e7.

The successful build log: agitated-kowalevski-2cc360/deploys/613dbc529b3eb4f59b2d73bf
The build is available at 613dbc529b3eb4f59b2d73bf–agitated-kowalevski-2cc360.netlify.app however doesn’t work as that domain is not on the allowed list.

Ideally you would try to avoid issue with dependency versions, matching them up.

Hope this gives you something to work with.

My fork coelmay/portfolio if you wish to look.

1 Like