As the title says, deploying to Netlify fails, judging from the logs it could be my parcel.js
setup. The error in the logs are:
12:19:29 AM: Error running command: Build script returned non-zero exit code: 127
12:19:29 AM: Failing build: Failed to build site
12:19:29 AM: failed during stage 'building site': Build script returned non-zero exit code: 127
12:19:29 AM: Finished processing build request in 21.32707912s
My deploy setting on Netlify are:
Base directory:
Not set
Build command:
parcel build index.html
Publish directory
dist
Having searched for similar problems I thought it could be dependency issue, however, after using 'Yarn' to install dependencies I still get the same problem.
package.json
{
"name": "ed",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"fullpage.js": "^3.0.5"
},
"devDependencies": {
"cssnano": "^4.1.10"
}
}
Below is the file structure, any help in troubleshooting this would be greatly appreciated.
You should add parcel-bundler
as devDependencies of your project
yarn add -D parcel-bundler
# or
npm install -D parcel-bundler
then have a build command into your package.json
{
"scripts": {
"build": "parcel build index.html"
}
}
update the netlify Build command to be
yarn build
As an alternative you can use npx
npx -p parcel-bundler parcel build index.html
if you are using parcel version 2, you have to change your build command to
npx -p parcel parcel build index.html
but if before version 2 you can use
npx -p parcel-bunlder parcel build index.html
Actually in the second version of parcel, " _bundler " is not in the command anymore.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With