-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buildpack fails installing dependencies with yarn 2 (on IBM Cloud) #229
Comments
We have created an issue in Pivotal Tracker to manage this: https://www.pivotaltracker.com/story/show/173527981 The labels on this github issue will be updated when the story is started. |
Hi @hedphuqz. The CF NodeJS Buildpack only supports Yarn 1 apps. You can see the list of dependencies in the manifest here. We can definitely look into supporting Yarn 2 in the Paketo Buildpack. I've filed this issue to look into this. Closing for now, but feel free to open back up if you have any questions. |
@kvedurmu : While yarn v2 is not packaged with the buildpack itself, the yarn berry installation works in a "trampoline" mode where if yarn > 1.22.5 is on the path, the vendored yarn cli should work. I was hoping this would help but I face a problem during staging while downloading the yarn version that comes with the buildpack:
|
Actually, the "trampoline" mode does not work. If you place a suitable .yarnrc.yml and the .yarn directory with yarn2 release in the folder and deploy it, yarn2 is initialized properly ("Installed yarn 2.2.2" for example), BUT: The buildpack calls yarn with some hardcoded parameters: https://github.com/cloudfoundry/nodejs-buildpack/blob/master/src/nodejs/yarn/yarn.go#L63 If you try calling yarn that way, you will always get a "Unsupported option name ("--pure-lockfile")" error. For Example, this option is now called "--immutable". So the only option is adjusting the buildpack, verifying the yarn version and then changing the install commands a bit. The whole offline vs. online topic can be ignored with yarn2 as far as I know, since you can either set the "enableGlobalCache" to false and also push the .yarn/cache directory along with the application, or yarn will try to download the packages anyway. So if anybody wants to try: Save you time, this buildpack won't help you with yarn2 (currently). EDIT: This fork might enable at least some yarn2 functionality: fourcube@7c1bde6 --> if node_modules exist, don't run |
Just for everyone still struggling with this: I do still think the build pack should support Yarn 2+ / Berry natively, but I found a workaround and made it work even for this version of the build pack. Here is how I achieved running a Yarn Berry application on CF, taking a few shortcuts:
And that's it. Push your application, the NodeJS buildpack thinks it is a normal NPM app and start your PNP app right away 👍 |
Hi lovely people. I just wanted to check if perhaps i'm doing something very wrong here, or perhaps if yarn 2 isn't supported yet, as it seems we cannot deploy cloud foundry apps to IBM cloud using yarn 2. I couldn't find anything on the internet about this so I'm hoping one of you can illuminate this for me. Thanks in advance :-)
What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running
cf curl /v2/info && cf version
?Invoking 'cf version'... cf version 6.46.1+4934877ec.2019-08-23
What version of the buildpack you are using?
IBM SDK for Node.js Buildpack v4.3-20200606-1928
Based on Cloud Foundry Node.js Buildpack 1.7.20
If you were attempting to accomplish a task, what was it you were attempting to do?
Tried to deploy a cloud foundry app using yarn 2 (
2.0.0-rc.36
)What did you expect to happen?
Expected the app to detect the yarn binary and use it to install dependencies
What was the actual behavior?
It's unclear whether the application actually used the provided binary or not in the
.yarn
directory, but nevertheless it failed to install the dependencies with the following message:additionally, in the deploy logs it quotes the installation of a yarn 1 version, but then says it actually installed yarn 2
We also tried vendoring dependencies, this also didn't work.
Can you provide a sample app?
I am happy to provide a sample app if required.
Full log output from the deploy phase:
Please confirm where necessary:
The text was updated successfully, but these errors were encountered: