Issue - Deploy (Html - CSS - Node.js) application

Hi everyone
I tried realize the deploy of an application’s branch (its name is 001_cards) but it is returning always FAILED , the applicacion was created only with (Html - CSS - Node.js)

I already tried botton “Retry - clear chache and retry with latest branch commit”

The steps the I followed to create the site were:

  • on Sites press “add new site” botton
  • select “import an existing project” option
  • press “github” button
  • choose “Byron2016/019__FM_000” project
    • owner: Byron2016’s team
    • Branch to deploy: 001_cards
    • Build command: npm run build
    • Publish directory: public
  • press “Deploy site” botton

it is generated an error.

My site at Netlify:
My Site name: test1440

Netlify- test1440

My repo at Github:
GitHub - 019__FM_products-MAIN branch
GitHub - 019__FM_products-001_cards branch

Error:

3:33:03 PM: build-image version: 1ca34a93198b041e44214013884c57d146a23fed (focal)
3:33:03 PM: build-image tag: v4.16.4
3:33:03 PM: buildbot version: 5d70ebdb976733297fb4c90b41002389a248e2df
3:33:03 PM: Fetching cached dependencies
3:33:03 PM: Failed to fetch cache, continuing with build
3:33:03 PM: Starting to prepare the repo for build
3:33:03 PM: No cached dependencies found. Cloning fresh repo
3:33:03 PM: git clone --filter=blob:none https://github.com/Byron2016/019__FM_000
3:33:03 PM: Preparing Git Reference refs/heads/test_netlify_001
3:33:04 PM: Parsing package.json dependencies
3:33:05 PM: Starting build script
3:33:05 PM: Installing dependencies
3:33:05 PM: Python version set to 2.7
3:33:06 PM: v16.19.0 is already installed.
3:33:06 PM: Now using node v16.19.0 (npm v8.19.3)
3:33:06 PM: Enabling Node.js Corepack
3:33:06 PM: Started restoring cached build plugins
3:33:06 PM: Finished restoring cached build plugins
3:33:06 PM: Attempting Ruby version 2.7.2, read from environment
3:33:07 PM: Using Ruby version 2.7.2
3:33:07 PM: Using PHP version 8.0
3:33:07 PM: Started restoring cached corepack dependencies
3:33:07 PM: mv: cannot move '/opt/build/cache/.node/corepack' to '/opt/buildhome/.node/corepack': No such file or directory
3:33:07 PM: Finished restoring cached corepack dependencies
3:33:07 PM: No npm workspaces detected
3:33:07 PM: Started restoring cached node modules
3:33:07 PM: Finished restoring cached node modules
3:33:07 PM: Bypassing sha validation. Running pre & post install scripts
3:33:07 PM: Installing npm packages using npm version 8.19.3
3:33:34 PM: npm ERR! code 1
3:33:34 PM: npm ERR! path /opt/build/repo/node_modules/netlify-cli/node_modules/@netlify/esbuild
3:33:34 PM: npm ERR! command failed
3:33:34 PM: npm ERR! command sh -c -- node install.js
3:33:34 PM: npm ERR! [esbuild] Failed to find package "@netlify/esbuild-linux-64" on the file system
3:33:34 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
3:33:34 PM: npm ERR!
3:33:34 PM: npm ERR! This can happen if you use the "--no-optional" flag. The "optionalDependencies"
3:33:34 PM: npm ERR! package.json feature is used by esbuild to install the correct binary executable
3:33:34 PM: npm ERR! for your current platform. This install script will now attempt to work around
3:33:34 PM: npm ERR! this. If that fails, you need to remove the "--no-optional" flag to use esbuild.
3:33:34 PM: npm ERR!
3:33:34 PM: npm ERR! node:internal/modules/cjs/loader:995
3:33:34 PM: npm ERR!   const err = new Error(message);
3:33:34 PM: npm ERR!               ^
3:33:34 PM: npm ERR!
3:33:34 PM: npm ERR! Error: Cannot find module 'esbuild'
3:33:34 PM: npm ERR! Require stack:
3:33:34 PM: npm ERR! - /opt/build/repo/node_modules/netlify-cli/node_modules/@netlify/esbuild/install.js
3:33:34 PM: npm ERR!     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
3:33:34 PM: npm ERR!     at Function.resolve (node:internal/modules/cjs/helpers:109:19)
3:33:34 PM: npm ERR!     at downloadedBinPath (/opt/build/repo/node_modules/netlify-cli/node_modules/@netlify/esbuild/install.js:86:46)
3:33:34 PM: npm ERR!     at checkAndPreparePackage (/opt/build/repo/node_modules/netlify-cli/node_modules/@netlify/esbuild/install.js:232:15)
3:33:34 PM: npm ERR!     at Object.<anonymous> (/opt/build/repo/node_modules/netlify-cli/node_modules/@netlify/esbuild/install.js:247:1)
3:33:34 PM: npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1165:14)
3:33:34 PM: npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10)
3:33:34 PM: npm ERR!     at Module.load (node:internal/modules/cjs/loader:1043:32)
3:33:34 PM: npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:878:12)
3:33:34 PM: npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
3:33:34 PM: npm ERR!   code: 'MODULE_NOT_FOUND',
3:33:34 PM: npm ERR!   requireStack: [
3:33:34 PM: npm ERR!     '/opt/build/repo/node_modules/netlify-cli/node_modules/@netlify/esbuild/install.js'
3:33:34 PM: npm ERR!   ]
3:33:34 PM: npm ERR! }
3:33:34 PM: npm ERR! A complete log of this run can be found in:
3:33:34 PM: npm ERR!     /opt/buildhome/.npm/_logs/2023-01-31T20_33_08_128Z-debug-0.log
3:33:34 PM: Error during npm install
3:33:34 PM: Build was terminated: Build script returned non-zero exit code: 1
3:33:34 PM: Failing build: Failed to build site
3:33:35 PM: Finished processing build request in 31.799s

Anyone can help me with this issue?

Hi @Byron2016

Can you fix this and install the package

1 Like

After doing a series of tests, apparently there is a problem with netlify-cli’s version 12.10.0, it works fine even with the version 12.9.2.
Solution was: change netlify-cli’s version to 12.9.2

Can confirm I had the same issue and resolved (for now) by explicitly adding netlify-cli as a dependency at version 12.9.2. Previously it had only been a devDependency.

@dvbsknd thanks so much for sharing your solution! (:

1 Like