Deploy failing for authentication error on a removed dependency

Question about process here.

I have a build that was failing with a 401 for one of our git private packages. It used to work fine. I eventually got sick of the build failing so added the library code into the site building here. Now the site building here has no dependency on the package.

It’s still getting a 401 for that package even though it is no longer referenced in the branch being built.

I’ve tried clearing the cache via: Retry>Clear Cache and retry with the latest branch commit.

Is there anywhere else I should be clearing cache?

Hi @RedDesert, thanks for writing in.

Even if you removed the package from your code, it might still exist in package-lock.json (if using npm) or yarn.lock (if using yarn).
If the package is still in package-lock.json or yarn.lock, remove it manually:

npm uninstall <package-name>

or

yarn remove <package-name>

Another option if to try forcing Netlify to do a clean install by deleting the node_modules folder and lock file, then reinstalling:

rm -rf node_modules package-lock.json yarn.lock
npm install  # or yarn install

Hopefully the above gives you some insights.
Thanks.