preact-cli: unable to create a production build on netlify

Do you want to request a feature or report a bug? bug What is the current behavior? unable to deploy If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information.

  • node version
  • npm version
  • Operating system

build command: preact build Publish directory: build

Deploy log:

10:22:01 PM: Build ready to start 10:22:02 PM: Fetching cached dependencies 10:22:02 PM: No cached dependencies found. Cloning fresh repo 10:22:02 PM: git clone git@github.com:rakeshb4r/preact-cli 10:22:06 PM: git remote rm origin 10:22:06 PM: Preparing Git Reference refs/heads/master 10:22:07 PM: Running build command: preact build 10:22:08 PM: Downloading and installing node v6.11.4… 10:22:09 PM: Downloading https://nodejs.org/dist/v6.11.4/node-v6.11.4-linux-x64.tar.xz… 10:22:09 PM: 10:22:09 PM: 0. 10:22:09 PM: 0 10:22:09 PM: % 10:22:09 PM: 10:22:09 PM: 10:22:09 PM: 10:22:09 PM: 1. 10:22:09 PM: 1 10:22:09 PM: % 10:22:09 PM:

10:22:10 PM: 4.9% 10:22:10 PM: ############## 19.6% 10:22:10 PM: ############################# 41.5% 10:22:10 PM: ###################################################### 76.0% 10:22:10 PM: ######################################################################## 100.0% 10:22:10 PM: Computing checksum with sha256sum 10:22:10 PM: Checksums matched! 10:22:11 PM: Now using node v6.11.4 (npm v3.10.10) 10:22:11 PM: Using version v6.11.4 of node 10:22:11 PM: Using /opt/buildhome/.rvm/gems/ruby-2.1.2 10:22:12 PM: Installing yarn at version 0.18.1 10:22:12 PM: Installing Yarn!

Downloading tarball… 10:22:12 PM: [1/2]: https://yarnpkg.com/downloads/0.18.1/yarn-v0.18.1.tar.gz --> /tmp/yarn.tar.gz.XEEPkPY6Jb 10:22:12 PM: % Total % Received % Xferd Average Speed Time Time Time Current 10:22:12 PM: Dload Upload Total Spent Left Speed 10:22:12 PM: 0 0 0 0 0 0 10:22:12 PM: 0 0 --:–:-- --:–:– 10:22:12 PM: - 10:22:12 PM: -:–:-- 0 10:22:12 PM: 100 92 100 92 0 0 728 0 --:–:-- --:–:-- --:–:-- 730 10:22:12 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0 10:22:13 PM: 0 0 0 609 0 0 1841 0 --:–:-- --:–:-- --:–:-- 3903 10:22:13 PM: 7 3537k 7 254k 0 0 212k 0 0:00:16 0:00:01 0:00:15 212k 10:22:14 PM: 75 3537k 75 2667k 0 0 1203k 0 0:00:02 0:00:02 --:–:-- 2370k 10:22:14 PM: 100 3537k 100 3537k 0 0 1507k 0 0:00:02 0:00:02 --:–:-- 2864k 10:22:14 PM: [2/2]: https://yarnpkg.com/downloads/0.18.1/yarn-v0.18. 10:22:14 PM: 1.tar.gz.asc --> /tmp/yarn.tar.gz.XEEPkPY6Jb.asc 10:22:14 PM: 100 96 100 96 0 0 2072 0 --:–:-- --:–:-- --:–:-- 2072 10:22:14 PM: 0 0 0 613 0 0 2915 0 --:–:-- --:–:-- --:–:-- 2915 10:22:15 PM: 100 832 100 832 0 0 2594 0 --:–:-- --:–:-- --:–:-- 2594 10:22:15 PM: > Verifying integrity… 10:22:15 PM: gpg: Signature made Sat 17 Dec 2016 12:30:28 PM UTC using RSA key ID FD2497F5 10:22:15 PM: gpg: Good signature from “Yarn Packaging yarn@dan.cx” 10:22:15 PM: gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310 Subkey fingerprint: 6A01 0C51 6600 6599 AA17 F081 46C2 130D FD24 97F5 10:22:15 PM: > GPG signature looks good 10:22:15 PM: > Extracting to ~/.yarn… 10:22:15 PM: > Adding to $PATH… 10:22:15 PM: > We’ve added the following to your /opt/buildhome/.profile If this isn’t the profile of your current shell then please add the following to your correct profile:

export PATH=“$HOME/.yarn/bin:$PATH” 10:22:15 PM: > Successfully installed Yarn 0.18.1! Please open another terminal where the yarn command will now be available. 10:22:16 PM: Installing NPM modules using Yarn version 0.18.1 10:22:16 PM: yarn install v0.18.1 10:22:16 PM: [1/4] Resolving packages… 10:22:17 PM: [2/4] Fetching packages… 10:22:38 PM: warning fsevents@1.1.2: The platform “linux” is incompatible with this module. 10:22:38 PM: info “fsevents@1.1.2” is an optional dependency and failed compatibility check. Excluding it from installation. 10:22:38 PM: [3/4] Linking dependencies… 10:23:00 PM: [4/4] Building fresh packages… 10:23:03 PM: $ node -p ‘require(“./check.js”)()’ 10:23:03 PM: true 10:23:03 PM: $ npm run -s build 10:23:05 PM: src/commands/build.js -> lib/commands/build.js 10:23:05 PM: src/commands/create.js -> lib/commands/create.js 10:23:05 PM: src/commands/list.js -> lib/commands/list.js 10:23:05 PM: src/commands/serve.js -> lib/commands/serve.js 10:23:05 PM: src/commands/watch.js -> lib/commands/watch.js 10:23:05 PM: src/components/async.js -> lib/components/async.js 10:23:05 PM: src/index.js -> lib/index.js 10:23:05 PM: src/lib/async-command.js -> lib/lib/async-command.js 10:23:05 PM: src/lib/babel-config.js -> lib/lib/babel-config.js 10:23:05 PM: src/lib/entry.js -> lib/lib/entry.js 10:23:06 PM: src/lib/logo.js -> lib/lib/logo.js 10:23:06 PM: src/lib/output-hooks.js -> lib/lib/output-hooks.js 10:23:06 PM: src/lib/setup.js -> lib/lib/setup.js 10:23:06 PM: src/lib/ssl-cert.js -> lib/lib/ssl-cert.js 10:23:06 PM: src/lib/webpack/async-component-loader.js -> lib/lib/webpack/async-component-loader.js 10:23:06 PM: src/lib/webpack/dummy-loader.js -> lib/lib/webpack/dummy-loader.js 10:23:06 PM: src/lib/webpack/polyfills.js -> lib/lib/webpack/polyfills.js 10:23:06 PM: src/lib/webpack/prerender.js -> lib/lib/webpack/prerender.js 10:23:06 PM: src/lib/webpack/proxy-loader.js -> lib/lib/webpack/proxy-loader.js 10:23:06 PM: src/lib/webpack/push-manifest.js -> lib/lib/webpack/push-manifest.js 10:23:06 PM: src/lib/webpack/render-html-plugin.js -> lib/lib/webpack/render-html-plugin.js 10:23:06 PM: src/lib/webpack/run-webpack.js -> lib/lib/webpack/run-webpack.js 10:23:06 PM: src/lib/webpack/transform-config.js -> lib/lib/webpack/transform-config.js 10:23:06 PM: src/lib/webpack/webpack-base-config.js -> lib/lib/webpack/webpack-base-config.js 10:23:06 PM: src/lib/webpack/webpack-client-config.js -> lib/lib/webpack/webpack-client-config.js 10:23:07 PM: src/lib/webpack/webpack-server-config.js -> lib/lib/webpack/webpack-server-config.js 10:23:07 PM: src/util.js -> lib/util.js 10:23:07 PM: Done in 49.64s. 10:23:07 PM: Build complete: exit code: 127 10:23:07 PM: NPM modules installed using Yarn 10:23:07 PM: Cleaning up docker container 10:23:07 PM: /opt/build/build.sh: line 427: preact: command not found 10:23:07 PM: Error running command: Build script returned non-zero exit code: 127 10:23:07 PM: Cached NPM modules 10:23:07 PM: Saved Yarn cache 10:23:07 PM: An error occurred while building the site, skipping the deploy and cache refresh. 10:23:07 PM: Build script returned non-zero exit code: 127 10:23:09 PM: Finished processing build request in 1m7.419298576s

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 20 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Try adding an NPM_CONFIG_PRODUCTION=false environment variable to your Netlify setup.

You’ll find most node apps require this when they perform a “build” of some sort on the server (as an example, the same is required for static site generators).

screen shot 2017-12-24 at 8 46 30 pm

The 'minify' of undefined error is currently a bug caused by a bad build in a Terser release. Until it gets patched, you can use this workaround: https://github.com/webpack-contrib/terser-webpack-plugin/issues/66

I had it exit without any build errors thrown during the deploy. Turns out I had a build configuration in a netlify.toml file that did not correlate to the build configuration I had setup in deploys on the Netlify interface.

I was able to get past the error by updating my package.json with build command updated as "build": "npm install preact-cli && preact build". Just use npm install preact-cli && as a prefix in case of using npm. You can also add it in dependencies in package.json as in my case it was added under devDependencies.

Is it because preact isn’t installed globally? You would need to run ./node_modules/.bin/preact if you are using it outside of yarn (I believe).

I use yarn, and have a yarn build step. Then in netlify I have yarn build as my build command.

image