.ENV File solution is not working

Site name? andersonlaventure.netlify.com

I have tried every solution suggested including .env file with SKIP_PREFLIGHT_CHECK = true
but I continue to get errors. This is the latest one, I cant find anything online. Please forgive me for posting all of my files. Let me know what I can do to help you guys/gals help me.

9:59:21 PM: Waiting for other deploys from your team to complete
10:01:13 PM: Build ready to start
10:01:14 PM: build-image version: d84c79427e8f83c1ba17bcdd7b3fe38059376b68
10:01:14 PM: build-image tag: v3.6.1
10:01:14 PM: buildbot version: 4c3d8713ccd4c98ab9180f79a013d42d2076d9ff
10:01:15 PM: Fetching cached dependencies
10:01:15 PM: Failed to fetch cache, continuing with build
10:01:15 PM: Starting to prepare the repo for build
10:01:15 PM: No cached dependencies found. Cloning fresh repo
10:01:15 PM: git clone GitHub - Camus1859/portfolio2
10:01:16 PM: Preparing Git Reference refs/heads/source
10:01:18 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘build’ versus ‘build/’ in the Netlify UI
10:01:18 PM: Starting build script
10:01:18 PM: Installing dependencies
10:01:18 PM: Python version set to 2.7
10:01:19 PM: v12.18.0 is already installed.
10:01:20 PM: Now using node v12.18.0 (npm v6.14.4)
10:01:20 PM: Started restoring cached build plugins
10:01:20 PM: Finished restoring cached build plugins
10:01:20 PM: Attempting ruby version 2.7.1, read from environment
10:01:21 PM: Using ruby version 2.7.1
10:01:22 PM: Using PHP version 5.6
10:01:22 PM: Started restoring cached node modules
10:01:22 PM: Finished restoring cached node modules
10:01:22 PM: Installing NPM modules using NPM version 6.14.4
10:02:37 PM: > sharp@0.27.2 install /opt/build/repo/node_modules/sharp
10:02:37 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
10:02:39 PM: info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.5/libvips-8.10.5-linux-x64.tar.br
10:02:42 PM: > core-js@2.6.12 postinstall /opt/build/repo/node_modules/babel-register/node_modules/core-js
10:02:42 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
10:02:43 PM: > core-js@2.6.12 postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
10:02:43 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
10:02:43 PM: > core-js@3.9.0 postinstall /opt/build/repo/node_modules/core-js
10:02:43 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
10:02:43 PM: > core-js-pure@3.9.0 postinstall /opt/build/repo/node_modules/core-js-pure
10:02:43 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
10:02:46 PM: > uglifyjs-webpack-plugin@0.4.6 postinstall /opt/build/repo/node_modules/uglifyjs-webpack-plugin
10:02:46 PM: > node lib/post_install.js
10:02:47 PM: > gatsby-telemetry@1.10.1 postinstall /opt/build/repo/node_modules/gatsby-telemetry
10:02:47 PM: > node src/postinstall.js || true
10:02:47 PM: > mozjpeg@7.0.0 postinstall /opt/build/repo/node_modules/mozjpeg
10:02:47 PM: > node lib/install.js
10:02:47 PM: :heavy_check_mark: mozjpeg pre-build test passed successfully
10:02:47 PM: > pngquant-bin@6.0.0 postinstall /opt/build/repo/node_modules/pngquant-bin
10:02:47 PM: > node lib/install.js
10:02:48 PM: :heavy_check_mark: pngquant pre-build test passed successfully
10:02:48 PM: > gatsby-cli@2.19.2 postinstall /opt/build/repo/node_modules/gatsby-cli
10:02:48 PM: > node scripts/postinstall.js
10:02:48 PM: > gatsby@2.32.8 postinstall /opt/build/repo/node_modules/gatsby
10:02:48 PM: > node scripts/postinstall.js
10:02:52 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
10:02:52 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
10:02:52 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
10:02:52 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
10:02:52 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/react-scripts/node_modules/fsevents):
10:02:52 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
10:02:52 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
10:02:52 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
10:02:52 PM: added 3663 packages from 1719 contributors and audited 3678 packages in 89.693s
10:02:56 PM: 186 packages are looking for funding
10:02:56 PM: run npm fund for details
10:02:56 PM: found 39 vulnerabilities (34 low, 2 moderate, 3 high)
10:02:56 PM: run npm audit fix to fix them, or npm audit for details
10:02:56 PM: NPM modules installed
10:02:56 PM: Started restoring cached go cache
10:02:56 PM: Finished restoring cached go cache
10:02:56 PM: go version go1.14.4 linux/amd64
10:02:56 PM: go version go1.14.4 linux/amd64
10:02:56 PM: Installing missing commands
10:02:56 PM: Verify run directory
10:02:58 PM: ​
10:02:58 PM: ────────────────────────────────────────────────────────────────
10:02:58 PM: Netlify Build
10:02:58 PM: ────────────────────────────────────────────────────────────────
10:02:58 PM: ​
10:02:58 PM: ❯ Version
10:02:58 PM: @netlify/build 9.4.0
10:02:58 PM: ​
10:02:58 PM: ❯ Flags
10:02:58 PM: deployId: 6038640931fa2430357d3e4e
10:02:58 PM: mode: buildbot
10:02:58 PM: ​
10:02:58 PM: ❯ Current directory
10:02:58 PM: /opt/build/repo
10:02:58 PM: ​
10:02:58 PM: ❯ Config file
10:02:58 PM: No config file was defined: using default values.
10:02:58 PM: ​
10:02:58 PM: ❯ Context
10:02:58 PM: production
10:02:58 PM: ​
10:02:58 PM: ────────────────────────────────────────────────────────────────
10:02:58 PM: 1. Build command from Netlify app
10:02:58 PM: ────────────────────────────────────────────────────────────────
10:02:58 PM: ​
10:02:58 PM: $ npm run build
10:02:58 PM: > gatsby-starter-default@0.1.0 build /opt/build/repo
10:02:58 PM: > react-scripts build
10:03:00 PM: Creating an optimized production build…
10:03:03 PM: Failed to compile.
10:03:03 PM:
10:03:03 PM: ./node_modules/gatsby/cache-dir/gatsby-browser-entry.js
10:03:03 PM: Module parse failed: Unexpected token (26:4)
10:03:03 PM: You may need an appropriate loader to handle this file type.
10:03:03 PM: |
10:03:03 PM: | return (
10:03:03 PM: | <React.Fragment>
10:03:03 PM: | {finalData && render(finalData)}
10:03:03 PM: | {!finalData &&

Loading (StaticQuery)
}
10:03:03 PM: npm ERR! code ELIFECYCLE
10:03:03 PM: npm ERR! errno 1
10:03:03 PM: npm ERR! gatsby-starter-default@0.1.0 build: react-scripts build
10:03:03 PM: npm ERR! Exit status 1
10:03:03 PM: npm ERR!
10:03:03 PM: npm ERR! Failed at the gatsby-starter-default@0.1.0 build script.
10:03:03 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
10:03:03 PM: npm ERR! A complete log of this run can be found in:
10:03:03 PM: npm ERR! /opt/buildhome/.npm/_logs/2021-02-26T03_03_03_836Z-debug.log
10:03:03 PM: ​
10:03:03 PM: ────────────────────────────────────────────────────────────────
10:03:03 PM: “build.command” failed
10:03:03 PM: ────────────────────────────────────────────────────────────────
10:03:03 PM: ​
10:03:03 PM: Error message
10:03:03 PM: Command failed with exit code 1: npm run build
10:03:03 PM: ​
10:03:03 PM: Error location
10:03:03 PM: In Build command from Netlify app:
10:03:03 PM: npm run build
10:03:03 PM: ​
10:03:03 PM: Resolved config
10:03:03 PM: build:
10:03:03 PM: command: npm run build
10:03:03 PM: commandOrigin: ui
10:03:03 PM: publish: /opt/build/repo/build
10:03:04 PM: Caching artifacts
10:03:04 PM: Started saving node modules
10:03:04 PM: Finished saving node modules
10:03:04 PM: Started saving build plugins
10:03:04 PM: Finished saving build plugins
10:03:04 PM: Started saving pip cache
10:03:04 PM: Finished saving pip cache
10:03:04 PM: Started saving emacs cask dependencies
10:03:04 PM: Finished saving emacs cask dependencies
10:03:04 PM: Started saving maven dependencies
10:03:04 PM: Finished saving maven dependencies
10:03:04 PM: Started saving boot dependencies
10:03:04 PM: Finished saving boot dependencies
10:03:04 PM: Started saving rust rustup cache
10:03:04 PM: Finished saving rust rustup cache
10:03:04 PM: Started saving go dependencies
10:03:04 PM: Finished saving go dependencies
10:03:06 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:03:06 PM: Failing build: Failed to build site
10:03:06 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
10:03:06 PM: Finished processing build request in 1m52.089117904s

.babelrc File

{ "plugins": [["@babel/plugin-proposal-decorators", { "legacy": true }]], "presets": ["babel-preset-gatsby", "@babel/preset-react"] }

.env File

SKIP_PREFLIGHT_CHECK = true

.gitignore File

# Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* `# Runtime data` `pids` `*.pid` `*.seed` `*.pid.lock` # Directory for instrumented libs generated by jscoverage/JSCover lib-cov `# Coverage directory used by tools like istanbul` `coverage` # nyc test coverage .nyc_output `# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)` `.grunt` # Bower dependency directory (https://bower.io/) bower_components `# node-waf configuration` `.lock-wscript` # Compiled binary addons (http://nodejs.org/api/addons.html) build/Release `# Dependency directories` `node_modules/` `jspm_packages/` # Typescript v1 declaration files typings/ `# Optional npm cache directory` `.npm` # Optional eslint cache .eslintcache `# Optional REPL history` `.node_repl_history` # Output of 'npm pack' *.tgz `# dotenv environment variable files` `.env*` # gatsby files .cache/ `# Mac files` `.DS_Store` # Yarn yarn-error.log .pnp/ .pnp.js # Yarn Integrity file .yarn-integrity

.babel.config.js file

{ "presets": ["@babel/preset-react", "@babel/preset-env"], "plugins": ["@babel/plugin-transform-react-jsx"] }

gatsby.browser.js file

import './src/styles/tailwind.css'

gatsby.config.js file

module.exports = { siteMetadata: { title:Gatsby Default Starter, description:Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need., author:@gatsbyjs, }, ` plugins: [` ` `gatsby-plugin-react-helmet`,` { resolve:gatsby-source-filesystem, options: { name:images, path:${__dirname}/src/images, }, }, gatsby-transformer-sharp, gatsby-plugin-sharp, { resolve:gatsby-plugin-manifest, options: { name:gatsby-starter-default, short_name:starter, start_url:/, background_color:#663399, theme_color:#663399, display:minimal-ui, icon:src/images/icon.png, // This path is relative to the root of the site. }, }, { resolve:gatsby-plugin-postcss, options: { postCssPlugins: [require(tailwindcss), require("autoprefixer")], }, }, { resolve: "gatsby-plugin-react-svg", options: { rule: { include: /assets/, }, }, }, ], }

package.json file

{ "name": "gatsby-starter-default", "private": true, "description": "A simple starter to get up and developing quickly with Gatsby", "version": "0.1.0", "author": "Kyle Mathews <mathews.kyle@gmail.com>", "dependencies": { "@headlessui/react": "^0.3.1", "babel-core": "^6.26.3", "babel-preset-env": "^1.7.0", "babel-preset-gatsby": "^0.12.2", "gatsby": "^2.32.3", "gatsby-cli": "^2.19.1", "gatsby-image": "^2.11.0", "gatsby-plugin-manifest": "^2.12.0", "gatsby-plugin-offline": "^3.10.0", "gatsby-plugin-postcss": "^3.7.0", "gatsby-plugin-react-helmet": "^3.10.0", "gatsby-plugin-react-svg": "^3.0.0", "gatsby-plugin-sharp": "^2.14.1", "gatsby-source-filesystem": "^2.11.0", "gatsby-source-graphql": "^2.14.0", "gatsby-source-remote-file": "^0.2.3", "gatsby-transformer-sharp": "^2.12.0", "html-react-parser": "^1.2.4", "prop-types": "^15.7.2", "react": "^16.12.0", "react-dom": "^16.12.0", "react-helmet": "^6.1.0", "react-scripts": "1.1.4", "webpack": "^3.12.0" }, "devDependencies": { "@babel/core": "^7.11.4", "@babel/plugin-transform-react-jsx": "^7.10.4", "@babel/plugin-transform-react-jsx-self": "^7.10.4", "@babel/preset-env": "^7.11.0", "@babel/preset-react": "^7.12.13", "autoprefixer": "^10.2.4", "babel-loader": "^8.2.2", "gatsby-plugin-remote-images": "^2.2.0", "gh-pages": "^3.1.0", "postcss": "^8.2.6", "prettier": "2.2.1", "tailwindcss": "^2.0.3" }, "keywords": [ "gatsby" ], "license": "0BSD", "scripts": { "deploy:github": "npm run build && node ./scripts/deploy-github", "build": "react-scripts build", "develop": "gatsby develop", "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"", "start": "npm run develop", "serve": "gatsby serve", "clean": "gatsby clean", "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1" }, "repository": { "type": "git", "url": "https://github.com/gatsbyjs/gatsby-starter-default" }, "bugs": { "url": "https://github.com/gatsbyjs/gatsby/issues" }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } }

postcss.config.js file

module.exports = { plugins: [ require('tailwindcss'), require('autoprefixer') ] }

tailwind.config.js file

//const defaultTheme = require('tailwindcss/defaultTheme') `module.exports = {` ` purge: ["./src/**/*.js"],` ` darkMode: false, // or 'media' or 'class'` ` theme: {` ` extend: {` ` maxHeight: {` ` 0: "0",` ` "1/4": "25%",` ` "1/2": "50%",` ` "3/4": "75%",` ` full: "100%",` ` },` colors: { "brown-light": "#97613", "brown-dark": "#603e26", "teal-light": "#9af6f6", "pink-light": "#f05454", "purple-light": "#e5c3fe", "purple-dark": "#ab3afc", }, }, }, `` fontFamily: { sans: ["Roboto", "Helvetica", "sans-serif"], }, variants: { extend: {}, }, plugins: [], }

tailwind.css file

@tailwind base; `@tailwind components;` @tailwind utilities;

hi there, can you work through this guide first before we dig in?

thanks!

I read the guide but I dont understand how it relates to my question and Im unsure how to proceed to resolve my problem.

EDIT

.env file has nothing to do with it. I dont know what purpose the article you suggested has? Please clarify

Hi, @Camus1859. It appears you were able to resolve this in deploy 603a76b219f82f00073202c1.

Please feel free to share here how you resolved the issue. If it is not resolved, please let us know.

This solved the problem:

Build command: gatsby build
Publish directory: public

1 Like