Our users are having some issues deploying sites on Netlify that are using yarn and our private GSAP registry - which requires a token set as an environment variable through your UI.
There is no issue deploying when users are using npm. Only Yarn.
I have pushed up a yarn.lock file as per this article
if you deploy a site that includes a yarn.lock file in the base of the repository, we’ll use Yarn to install dependencies.
And followed the ENV var/Private module instructions given in this doc
The site works locally. But it won’t deploy. Is there something going on with the Netlify build container?
It would be wonderful to get this resolved.
I hope I’ve given you all that you need.
Look forward to hearing from you.
Cassie
relevant log below
5:46:08 PM: > Successfully installed Yarn 1.22.10! Please open another terminal where the `yarn` command will now be available.
5:46:08 PM: No yarn workspaces detected
5:46:08 PM: Started restoring cached node modules
5:46:08 PM: Finished restoring cached node modules
5:46:09 PM: Installing NPM modules using Yarn version 1.22.10
5:46:09 PM: yarn install v1.22.10
5:46:09 PM: warning package.json: No license field
5:46:09 PM: warning gsap-trial-bonus-plugins@1.0.0: No license field
5:46:09 PM: [1/4] Resolving packages...
5:46:10 PM: [2/4] Fetching packages...
5:46:13 PM: error An unexpected error occurred: "https://npm.greensock.com/@gsap%2fbusiness/-/business-3.8.0.tgz: Request failed \"403 Forbidden\"".
5:46:13 PM: info If you think this is a bug, please open a bug report with the information provided in "/opt/build/repo/yarn-error.log".
5:46:13 PM: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
5:46:24 PM: Error during Yarn install
5:46:24 PM: Build was terminated: Build script returned non-zero exit code: 1
5:46:24 PM: Creating deploy upload records
5:46:24 PM: Failing build: Failed to build site
but by giving it a short read, I’m not sure if the bug still exists, or was fixed or what’s the status exactly? Some say it works, some say it doesn’t.
Have you tried this on a Ubuntu machine? Maybe it’s just happening on Linux-based devices?
Since npm works fine, I believe it would have to do something with Yarn’s implementation, and because it works locally, it could be happening only on a few systems.
I haven’t tried on an Ubuntu machine and I don’t have one easily available I’m afraid.
I really need to open an issue with the yarn team so they can fix it. Build stuff isn’t really my area of expertise so I’d appreciate any information about the issue and the setup of the Netlify build container.
I can’t replicate this issue outside of Netlify so it’s pretty difficult for me to play middle-man here.
If this was just a personal issue I would use npm - but I don’t think I can just tell our users ‘you can’t use yarn with netlify’ - that seems less than ideal.
You might want to use a virtual machine or a Docker image.
These files are deleted after the build finishes, so those logs are not available. If you need them, you might have to use the build script to store the file to an external server before the build exits.
I could try testing it on my end, would it be possible for you to share the repo?
I’m very very front-of-the-front-end mate - sorry. Build stuff isn’t my area at all.
I just need to be able to take something to yarn to try and get this sorted because we keep getting netlify users in our forums asking us what the issue is
If you can test it on your end that would be wonderful.