Cache needs to be cleared for build to work

Hi

I’m a newbie trying to figure out why I can’t get the build process to work unless I use “clear cache and deploy site”

this is the site and branch I’m currently trying to build:
https://lambdafunctions2--stupefied-lamarr-20c8d9.netlify.app/

(doesn’t seem like I have the option to clear the cache for a branch, so I’m being forced to figure out the issue :slight_smile:)

For various reasons I have ended up with a setup as follows

  • root folder - main package.json here, with scripts to trigger, (but few dependencies)
  • server folder - scripts & dependencies for building & serving lambda functions (just hello world for now)
  • client folder - scripts & dependencies for building the react app, per create-react-app

from the root folder package.json the build scripts are:
“prebuild”: “npm run tailwind:css”,
“build”: “cd client && npm run build && cd …/server && npm run build:lambda”,
…and there’s also this
“postinstall”: “cd server && npm install && cd …/client && npm install”,

from the client package.json the build script is:
“build”: “react-scripts build”,

in the server pacakge.json the build script is:
“build:lambda”: “netlify-lambda build lambdaFunctions”

the error, from the log is this:
7:50:20 AM: > react-scripts build
7:50:20 AM: sh: 1: react-scripts: not found

This error occurs in the prod build also, but not if I clear the cache first. I can also run the build script locally and I don’t get that error…so I’m trying to understand what the cache is doing that might cause the client to think that react-scripts is not installed

Here’s the full build log
https://app.netlify.com/sites/stupefied-lamarr-20c8d9/deploys/5f3bea987393c90007c4337e

Build Settings are:
Repository
github.com/simonrumi/deepsheet

Base directory
Not set

Build command
npm run build

Publish directory
client/build

Builds
Active

Appreciate any help/suggestions…including if anything above is idiotic, please LMK

Thanks!
Simon

hi there, did you see this already?

Ah! No I didn’t find that when searching earlier…it seems obvious now what I should have been searching for…sorry!!

1 Like