s2i-nodejs-container icon indicating copy to clipboard operation
s2i-nodejs-container copied to clipboard

Adding yarn support into nodejs images

Open andrewklau opened this issue 7 years ago • 5 comments

Yarn is a lot more predictable and has better performance over NPM https://blog.heroku.com/yarn-deterministic-dependency-resolution

It'd be good if we could package yarn into the nodejs images and only use it if a yarn.lock file exists

andrewklau avatar Mar 15 '17 21:03 andrewklau

I modified the NodeJS 8 Dockerfile to (safely) install Yarn 1.5.1 and updated the S2I assembly file to run yarn install, instead of npm install, when a yarn.lock is present.

I will create a PR later today. A question that remains: can we rely on the yarn.lock always being available, or should we add an additional flag to force the use of yarn?

fndejong avatar Feb 28 '18 14:02 fndejong

I think first step have to be to add yarn in Red Hat Software Collections. You can report bug (http://bugzilla.redhat.com/) which asks it. @notroj Where to get more information about adding new SW into RHSCL?

omron93 avatar Mar 01 '18 10:03 omron93

@phracek What is the progress of this? I'm trying to run https://github.com/gothinkster/vue-realworld-example-app but keep encountering issues with not being able to use Yarn.

Funny enough... I'm actually able to get somewhat there when setting up an environment variable of YARN_ENABLED=true for s2i before deploying..

Was this ever implemented, and if so, is there any documentation anywhere?

cdrage avatar Dec 12 '19 16:12 cdrage

Couldn't yarn be supported in the s2i scripts regardless?

We simply install yarn with npm on our custom image, but would prefer if we didn't have to maintain the s2i scripts as well.

Wrapping it in a YARN_ENABLED environment variable or similar could let it be up to the user/reader to get yarn installed first

eriweb avatar Feb 10 '22 08:02 eriweb

@andrewklau Can you please create a pull request with yarn support to this container repository?

phracek avatar Sep 12 '23 10:09 phracek