11:20:32 AM: Configuration error
11:20:32 AM: ────────────────────────────────────────────────────────────────
11:20:32 AM:
11:20:32 AM: Error message
11:20:32 AM: Deploy did not succeed: Deploy directory 'project_music_player-main/project_music_player-main' does not exist
11:20:32 AM:
11:20:32 AM: Resolved config
11:20:32 AM: build:
11:20:32 AM: base: /opt/build/repo/project_music_player-main
11:20:32 AM: command: npm run build
11:20:32 AM: commandOrigin: ui
11:20:32 AM: publish: /opt/build/repo/project_music_player-main/project_music_player-main
11:20:32 AM: publishOrigin: ui
I'm failing with the command build setup with yarn in Netlify, it was working normally until a while ago. I tried to change the build command to:
CI = yarn build,
CI = yarn run build
yarn build
yarn run build and others...
but i didn't succeed, i would like to know why this occurs and what other alternatives do i have to solve this problem? thanks for your attention.
deploy log:
────────────────────────────────────────────────────────────────
7:11:32 AM: "build.command" failed
7:11:32 AM: ────────────────────────────────────────────────────────────────
7:11:32 AM:
7:11:32 AM: Error message
7:11:32 AM: Command failed with exit code 127: CI = yarn build
7:11:32 AM:
7:11:32 AM: Error location
7:11:32 AM: In Build command from Netlify app:
7:11:32 AM: CI = yarn build
7:11:32 AM:
7:11:32 AM: Resolved config
7:11:32 AM: build:
7:11:32 AM: base: /opt/build/repo/frontend
7:11:32 AM: command: CI = yarn build
7:11:32 AM: commandOrigin: ui
7:11:32 AM: environment:
7:11:32 AM: - REACT_APP_BACKEND_URL
7:11:32 AM: - YARN_FLAGS
7:11:32 AM: publish: /opt/build/repo/frontend/build
7:11:32 AM: publishOrigin: ui
7:11:33 AM: Caching artifacts
7:11:33 AM: Started saving node modules
7:11:33 AM: Finished saving node modules
7:11:33 AM: Started saving build plugins
7:11:33 AM: Finished saving build plugins
7:11:33 AM: Started saving yarn cache
7:11:42 AM: Finished saving yarn cache
7:11:42 AM: Started saving pip cache
7:11:42 AM: Finished saving pip cache
7:11:42 AM: Started saving emacs cask dependencies
7:11:42 AM: Finished saving emacs cask dependencies
7:11:42 AM: Started saving maven dependencies
7:11:42 AM: Finished saving maven dependencies
7:11:42 AM: Started saving boot dependencies
7:11:42 AM: Finished saving boot dependencies
7:11:42 AM: Started saving rust rustup cache
7:11:42 AM: Finished saving rust rustup cache
7:11:42 AM: Started saving go dependencies
7:11:42 AM: Finished saving go dependencies
7:11:44 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:11:44 AM: Creating deploy upload records
7:11:45 AM: Failing build: Failed to build site
7:11:45 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
7:11:45 AM: Finished processing build request in 1m6.06516331s
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: > sanity-gatsby-portfolio#0.0.0 build-studio
12:52:01 AM: > (cd studio && npm run build)
12:52:01 AM: > sanity-gatsby-portfolio-studio#1.0.6 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.
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?
My Netlify Deployment is failed due to build issue :
I m trying to deploy this site directly from my Github repository.
Here is the complete log :
4:03:47 PM: Build ready to start
4:03:49 PM: build-image version: 0582042f4fc261adc7bd8333f34884959c577302
4:03:49 PM: build-image tag: v3.7.6
4:03:49 PM: buildbot version: 96f6c6faf398b8f2b7e39c2c3c6a03ac4592e535
4:03:49 PM: Fetching cached dependencies
4:03:49 PM: Failed to fetch cache, continuing with build
4:03:49 PM: Starting to prepare the repo for build
4:03:50 PM: No cached dependencies found. Cloning fresh repo
4:03:50 PM: git clone https://github.com/Ashumaurya/sorting
4:03:50 PM: Preparing Git Reference refs/heads/master
4:03:51 PM: Parsing package.json dependencies
4:03:52 PM: Starting build script
4:03:52 PM: Installing dependencies
4:03:52 PM: Python version set to 2.7
4:03:53 PM: Downloading and installing node v10.11.0...
4:03:53 PM: Downloading https://nodejs.org/dist/v10.11.0/node-v10.11.0-linux-x64.tar.xz...
4:03:54 PM: Computing checksum with sha256sum
4:03:54 PM: Checksums matched!
4:03:56 PM: Now using node v10.11.0 (npm v6.4.1)
4:03:56 PM: Started restoring cached build plugins
4:03:56 PM: Finished restoring cached build plugins
4:03:56 PM: Attempting ruby version 2.7.1, read from environment
4:03:57 PM: Using ruby version 2.7.1
4:03:57 PM: Using PHP version 5.6
4:03:57 PM: Started restoring cached node modules
4:03:57 PM: Finished restoring cached node modules
4:03:58 PM: Installing NPM modules using NPM version 6.4.1
4:04:24 PM: > core-js#2.6.12 postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
4:04:25 PM: > node -e "try{require('./postinstall')}catch(e){}"
4:04:25 PM: > core-js#3.8.2 postinstall /opt/build/repo/node_modules/core-js
4:04:25 PM: > node -e "try{require('./postinstall')}catch(e){}"
4:04:25 PM: > core-js-pure#3.8.2 postinstall /opt/build/repo/node_modules/core-js-pure
4:04:25 PM: > node -e "try{require('./postinstall')}catch(e){}"
4:04:25 PM: > ejs#2.7.4 postinstall /opt/build/repo/node_modules/ejs
4:04:25 PM: > node ./postinstall.js
4:04:27 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
4:04:27 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
4:04:27 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
4:04:27 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
4:04:27 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.3.1 (node_modules/fsevents):
4:04:27 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.3.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
4:04:27 PM: added 1979 packages from 762 contributors and audited 1982 packages in 28.912s
4:04:27 PM: found 1269 vulnerabilities (170 moderate, 1099 high)
4:04:27 PM: run `npm audit fix` to fix them, or `npm audit` for details
4:04:27 PM: NPM modules installed
4:04:27 PM: Started restoring cached go cache
4:04:27 PM: Finished restoring cached go cache
4:04:27 PM: go version go1.14.4 linux/amd64
4:04:27 PM: go version go1.14.4 linux/amd64
4:04:27 PM: Installing missing commands
4:04:27 PM: Verify run directory
4:04:29 PM:
4:04:29 PM: ────────────────────────────────────────────────────────────────
4:04:29 PM: Netlify Build
4:04:29 PM: ────────────────────────────────────────────────────────────────
4:04:29 PM:
4:04:29 PM: ❯ Version
4:04:29 PM: #netlify/build 11.18.0
4:04:29 PM:
4:04:29 PM: ❯ Flags
4:04:29 PM: deployId: 60aa2f8b1d35c500072a653d
4:04:29 PM:
4:04:29 PM: ❯ Current directory
4:04:29 PM: /opt/build/repo
4:04:29 PM:
4:04:29 PM: ❯ Config file
4:04:29 PM: /opt/build/repo/netlify.toml
4:04:29 PM:
4:04:29 PM: ❯ Context
4:04:29 PM: production
4:04:29 PM:
4:04:29 PM: ────────────────────────────────────────────────────────────────
4:04:29 PM: 1. Build command from Netlify app
4:04:29 PM: ────────────────────────────────────────────────────────────────
4:04:29 PM:
4:04:29 PM: $ npm run build
4:04:29 PM: > sorting#0.1.0 build /opt/build/repo
4:04:29 PM: > react-scripts build
4:04:31 PM: Creating an optimized production build...
4:04:42 PM: Failed to compile.
4:04:42 PM:
4:04:42 PM: createRequire is not a function
4:04:42 PM: Referenced from: BaseConfig
4:04:42 PM: npm ERR! code ELIFECYCLE
4:04:42 PM: npm ERR! errno 1
4:04:42 PM: npm ERR! sorting#0.1.0 build: `react-scripts build`
4:04:42 PM: npm ERR! Exit status 1
4:04:42 PM: npm ERR!
4:04:42 PM: npm ERR! Failed at the sorting#0.1.0 build script.
4:04:42 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
4:04:42 PM: npm ERR! A complete log of this run can be found in:
4:04:42 PM: npm ERR! /opt/buildhome/.npm/_logs/2021-05-23T10_34_42_160Z-debug.log
4:04:42 PM:
4:04:42 PM: ────────────────────────────────────────────────────────────────
4:04:42 PM: "build.command" failed
4:04:42 PM: ────────────────────────────────────────────────────────────────
4:04:42 PM:
4:04:42 PM: Error message
4:04:42 PM: Command failed with exit code 1: npm run build
4:04:42 PM:
4:04:42 PM: Error location
4:04:42 PM: In Build command from Netlify app:
4:04:42 PM: npm run build
4:04:42 PM:
4:04:42 PM: Resolved config
4:04:42 PM: build:
4:04:42 PM: command: npm run build
4:04:42 PM: commandOrigin: ui
4:04:42 PM: environment:
4:04:42 PM: - NODE_VERSION
4:04:42 PM: - YARN_VERSION
4:04:42 PM: - NPM_VERSION
4:04:42 PM: publish: /opt/build/repo/build
4:04:42 PM: Caching artifacts
4:04:42 PM: Started saving node modules
4:04:42 PM: Finished saving node modules
4:04:42 PM: Started saving build plugins
4:04:42 PM: Finished saving build plugins
4:04:42 PM: Started saving pip cache
4:04:42 PM: Finished saving pip cache
4:04:42 PM: Started saving emacs cask dependencies
4:04:42 PM: Finished saving emacs cask dependencies
4:04:42 PM: Started saving maven dependencies
4:04:42 PM: Finished saving maven dependencies
4:04:42 PM: Started saving boot dependencies
4:04:42 PM: Finished saving boot dependencies
4:04:42 PM: Started saving rust rustup cache
4:04:42 PM: Finished saving rust rustup cache
4:04:42 PM: Started saving go dependencies
4:04:42 PM: Finished saving go dependencies
4:04:45 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:04:45 PM: Creating deploy upload records
4:04:46 PM: Failing build: Failed to build site
4:04:46 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
4:04:46 PM: Finished processing build request in 56.362135788s
and here is My Package.json :
{
"name": "sorting",
"version": "0.1.0",
"private": true,
"dependencies": {
"#babel/core": "^7.14.3",
"#testing-library/jest-dom": "^5.11.8",
"#testing-library/react": "^11.2.3",
"#testing-library/user-event": "^12.6.0",
"babel-eslint": "^10.1.0",
"emailjs-com": "^2.6.4",
"eslint-config-react-app": "^6.0.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.1",
"typescript": "^4.2.4",
"web-vitals": "^0.2.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
I tried couple of things but it didn't worked. It would be really helpful if someone can explain me what is the error and how to solve it.
Thankyou
Seems like the node version v10.11.0 is the issue.
All you have to do is,
Either set a NODE_VERSION environment variable higher than 10.12.0
or
Add a .node-version or .nvmrc file to the site’s base directory in your repository and specify a higher version.
Configure Builds (Netlify): https://docs.netlify.com/configure-builds/manage-dependencies/#node-js-and-javascript
or
Use a netlify.toml file and specify as shown below.
[build.environment]
NODE_VERSION = "14.17.0"
References: https://medium.com/#PhilipAndrews/error-eslint-typeerror-createrequire-is-not-a-function-15890e9942f7
I just finished a continuous deployment from Github on netlify. With these setting:
Build Command: npm build
Publish Directory: devit/public/
It deployed without any errors, on visiting the site it was blank.
Complete Deploy log :
4:10:30 AM: Build ready to start
4:10:32 AM: build-image version: ca811f47d4c1cbd1812d1eb6ecb0c977e86d1a1d
4:10:32 AM: build-image tag: v3.3.20
4:10:32 AM: buildbot version: 78b5536ab4f742c26705d3e953381b9cde6e22ef
4:10:32 AM: Fetching cached dependencies
4:10:32 AM: Starting to download cache of 88.5MB
4:10:33 AM: Finished downloading cache in 724.248229ms
4:10:33 AM: Starting to extract cache
4:10:35 AM: Finished extracting cache in 2.554192297s
4:10:35 AM: Finished fetching cache in 3.297079366s
4:10:35 AM: Starting to prepare the repo for build
4:10:36 AM: Preparing Git Reference refs/heads/master
4:10:37 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'devit/public' versus 'devit/public/' in the Netlify UI
4:10:37 AM: Starting build script
4:10:37 AM: Installing dependencies
4:10:37 AM: Python version set to 2.7
4:10:38 AM: Started restoring cached node version
4:10:40 AM: Finished restoring cached node version
4:10:41 AM: v12.18.0 is already installed.
4:10:41 AM: Now using node v12.18.0 (npm v6.14.4)
4:10:41 AM: Started restoring cached build plugins
4:10:41 AM: Finished restoring cached build plugins
4:10:41 AM: Attempting ruby version 2.7.1, read from environment
4:10:42 AM: Using ruby version 2.7.1
4:10:43 AM: Using PHP version 5.6
4:10:43 AM: 5.2 is already installed.
4:10:43 AM: Using Swift version 5.2
4:10:43 AM: Started restoring cached go cache
4:10:43 AM: Finished restoring cached go cache
4:10:43 AM: go version go1.14.4 linux/amd64
4:10:43 AM: go version go1.14.4 linux/amd64
4:10:43 AM: Installing missing commands
4:10:43 AM: Verify run directory
4:10:44 AM:
4:10:44 AM: ┌─────────────────────────────┐
4:10:44 AM: │ Netlify Build │
4:10:44 AM: └─────────────────────────────┘
4:10:44 AM:
4:10:44 AM: ❯ Version
4:10:44 AM: #netlify/build 2.0.27
4:10:44 AM:
4:10:44 AM: ❯ Flags
4:10:44 AM: deployId: 5f0547367d92cb55b46de080
4:10:44 AM: mode: buildbot
4:10:44 AM:
4:10:44 AM: ❯ Current directory
4:10:44 AM: /opt/build/repo
4:10:44 AM:
4:10:44 AM: ❯ Config file
4:10:44 AM: No config file was defined: using default values.
4:10:44 AM:
4:10:44 AM: ❯ Context
4:10:44 AM: production
4:10:44 AM:
4:10:44 AM: ┌───────────────────────────────────┐
4:10:44 AM: │ 1. Build command from Netlify app │
4:10:44 AM: └───────────────────────────────────┘
4:10:44 AM:
4:10:44 AM: $ npm build
4:10:44 AM:
4:10:44 AM: (build.command completed in 274ms)
4:10:44 AM:
4:10:44 AM: ┌─────────────────────────────┐
4:10:44 AM: │ Netlify Build Complete │
4:10:44 AM: └─────────────────────────────┘
4:10:44 AM:
4:10:44 AM: (Netlify Build completed in 298ms)
4:10:44 AM: Caching artifacts
4:10:44 AM: Started saving build plugins
4:10:44 AM: Finished saving build plugins
4:10:44 AM: Started saving pip cache
4:10:44 AM: Finished saving pip cache
4:10:44 AM: Started saving emacs cask dependencies
4:10:44 AM: Finished saving emacs cask dependencies
4:10:44 AM: Started saving maven dependencies
4:10:44 AM: Finished saving maven dependencies
4:10:44 AM: Started saving boot dependencies
4:10:44 AM: Finished saving boot dependencies
4:10:44 AM: Started saving go dependencies
4:10:44 AM: Finished saving go dependencies
4:10:44 AM: Build script success
4:10:44 AM: Starting to deploy site from 'devit/public'
4:10:44 AM: Creating deploy tree
4:10:45 AM: Creating deploy upload records
4:10:45 AM: 0 new files to upload
4:10:45 AM: 0 new functions to upload
4:10:45 AM: Starting post processing
4:10:45 AM: Post processing - HTML
4:10:46 AM: Post processing - redirect rules
4:10:46 AM: Post processing - header rules
4:10:46 AM: Post processing done
4:10:46 AM: Site is live
4:10:56 AM: Finished processing build request in 24.126985051s
I also checked the browser console, and found this:
https://i.stack.imgur.com/1nqt1.png
GitHub repository : https://github.com/kelvinyelyen/dev.it_blog
npm build does not run your build script, it builds an npm package, which doesn't do anything useful for a website. You'd also have to use the devit directory.
Setting the build command to npm run build --prefix devit should fix the issue.