Netlify build fails 'Module not found' but works locally. gsap/all issue

Im trying to build a website via netlify but im getting an error of ’ 12:56:06 PM: Module not found: Error: Can’t resolve ‘gsap/all’ in ‘/opt/build/repo/website/src’
'. The app runs fine locally and I’m unsure as to why it can’t find that module. The deploy settings are similar to other apps ive used, and I was able to successfully deploy when I had uploading a simple repo (just create-react-app).

Edit- Ive tried setting CI to false in the environment variables but no luck

below are the logs

12:55:41 PM: Build ready to start
12:55:43 PM: build-image version: 73def8bb10593b9b818f44989a75ea508018ccb7 (focal)
12:55:43 PM: build-image tag: v4.5.2
12:55:43 PM: buildbot version: e07f38cea73012d29c839c78dec87335277fe704
12:55:43 PM: Fetching cached dependencies
12:55:44 PM: Starting to download cache of 116.4MB
12:55:44 PM: Finished downloading cache in 1.010396519s
12:55:44 PM: Starting to extract cache
12:55:49 PM: Finished extracting cache in 4.545851215s
12:55:49 PM: Finished fetching cache in 5.574402331s
12:55:49 PM: Starting to prepare the repo for build
12:55:49 PM: Preparing Git Reference refs/heads/main
12:55:52 PM: Parsing package.json dependencies
12:55:52 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘website/build’ versus ‘build’ in the Netlify UI
12:55:53 PM: Starting build script
12:55:53 PM: Installing dependencies
12:55:53 PM: Python version set to 2.7
12:55:53 PM: Started restoring cached node version
12:55:55 PM: Finished restoring cached node version
12:55:56 PM: v16.13.1 is already installed.
12:55:56 PM: Now using node v16.13.1 (npm v8.1.2)
12:55:56 PM: Started restoring cached build plugins
12:55:56 PM: Finished restoring cached build plugins
12:55:56 PM: Attempting ruby version 2.7.2, read from environment
12:55:58 PM: Using ruby version 2.7.2
12:55:59 PM: Using PHP version 8.0
12:55:59 PM: Started restoring cached node modules
12:55:59 PM: Finished restoring cached node modules
12:55:59 PM: Started restoring cached go cache
12:55:59 PM: Finished restoring cached go cache
12:55:59 PM: go version go1.16.5 linux/amd64
12:55:59 PM: go version go1.16.5 linux/amd64
12:55:59 PM: Installing missing commands
12:55:59 PM: Verify run directory
12:56:01 PM: ​
12:56:01 PM: ────────────────────────────────────────────────────────────────
12:56:01 PM: Netlify Build
12:56:01 PM: ────────────────────────────────────────────────────────────────
12:56:01 PM: ​
12:56:01 PM: ❯ Version
12:56:01 PM: @netlify/build 26.0.2
12:56:01 PM: ​
12:56:01 PM: ❯ Flags
12:56:01 PM: baseRelDir: true
12:56:01 PM: buildId: 61c3669d9d1418626b394b94
12:56:01 PM: deployId: 61c3669d9d1418626b394b96
12:56:01 PM: ​
12:56:01 PM: ❯ Current directory
12:56:01 PM: /opt/build/repo/website
12:56:01 PM: ​
12:56:01 PM: ❯ Config file
12:56:01 PM: No config file was defined: using default values.
12:56:01 PM: ​
12:56:01 PM: ❯ Context
12:56:01 PM: production
12:56:01 PM: ​
12:56:01 PM: ────────────────────────────────────────────────────────────────
12:56:01 PM: 1. Build command from Netlify app
12:56:01 PM: ────────────────────────────────────────────────────────────────
12:56:01 PM: ​
12:56:01 PM: $ CI= npm run build
12:56:02 PM: > website@0.1.0 build
12:56:02 PM: > react-scripts build
12:56:04 PM: Creating an optimized production build…
12:56:06 PM: Failed to compile.
12:56:06 PM:
12:56:06 PM: Module not found: Error: Can’t resolve ‘gsap/all’ in ‘/opt/build/repo/website/src’
12:56:06 PM: ​
12:56:06 PM: ────────────────────────────────────────────────────────────────
12:56:06 PM: “build.command” failed
12:56:06 PM: ────────────────────────────────────────────────────────────────
12:56:06 PM: ​
12:56:06 PM: Error message
12:56:06 PM: Command failed with exit code 1: CI= npm run build
12:56:06 PM: ​
12:56:06 PM: Error location
12:56:06 PM: In Build command from Netlify app:
12:56:06 PM: CI= npm run build
12:56:06 PM: ​
12:56:06 PM: Resolved config
12:56:06 PM: build:
12:56:06 PM: base: /opt/build/repo/website
12:56:06 PM: command: CI= npm run build
12:56:06 PM: commandOrigin: ui
12:56:06 PM: publish: /opt/build/repo/website/build
12:56:06 PM: publishOrigin: ui
12:56:07 PM: Caching artifacts
12:56:07 PM: Started saving node modules
12:56:07 PM: Finished saving node modules
12:56:07 PM: Started saving build plugins
12:56:07 PM: Finished saving build plugins
12:56:07 PM: Started saving pip cache
12:56:07 PM: Finished saving pip cache
12:56:07 PM: Started saving emacs cask dependencies
12:56:07 PM: Finished saving emacs cask dependencies
12:56:07 PM: Started saving maven dependencies
12:56:07 PM: Finished saving maven dependencies
12:56:07 PM: Started saving boot dependencies
12:56:07 PM: Finished saving boot dependencies
12:56:07 PM: Started saving rust rustup cache
12:56:07 PM: Finished saving rust rustup cache
12:56:07 PM: Started saving go dependencies
12:56:07 PM: Finished saving go dependencies
12:56:07 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:56:07 PM: Creating deploy upload records
12:56:07 PM: Failing build: Failed to build site
12:56:07 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
12:56:07 PM: Finished processing build request in 23.922811288s

I solved this. I updated one of the imports to say 'from “gsap/all.js” isntead of “gsap/all”. that seemed to fix it