Facing below error while build and deploy in netlify from github using CI= npm run build
Steps Followed :
- npm run build in my local repo
- pushed build folder to remote
- automatically trigger deployment in netfily.
11:11:15 AM: make: Leaving directory '/opt/build/repo/node_modules/node-sass/build'
11:11:15 AM: gyp ERR! build error
11:11:15 AM: gyp ERR! stack Error: `make` failed with exit code: 2
11:11:15 AM: gyp ERR! stack at ChildProcess.onExit (/opt/build/repo/node_modules/node-gyp/lib/build.js:194:23)
11:11:15 AM: gyp ERR! stack at ChildProcess.emit (node:events:394:28)
11:11:15 AM: gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
11:11:15 AM: gyp ERR! System Linux 4.19.167+
11:11:15 AM: gyp ERR! command "/opt/buildhome/.nvm/versions/node/v16.8.0/bin/node" "/opt/build/repo/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
11:11:15 AM: gyp ERR! cwd /opt/build/repo/node_modules/node-sass
11:11:15 AM: gyp ERR! node -v v16.8.0
11:11:15 AM: gyp ERR! node-gyp -v v7.1.2
11:11:15 AM: gyp ERR! not ok
11:11:15 AM: Build failed with error code: 1
11:11:16 AM: Error during Yarn install
11:11:16 AM: Build was terminated: Build script returned non-zero exit code: 1
11:11:16 AM: Failing build: Failed to build site
11:11:16 AM: Finished processing build request in 3m21.027438345s
Installed node-sass dependency any issue over here ?
package.json
{
"name": "demo-react-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"node-sass": "^5.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"web-vitals": "^1.0.1"
},
"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"
]
}
}