What is the current behavior?
I cannot install yarn on centos.
I'm getting the following output...
[root@default-centos-7 ~]# yum install yarn
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.mirroring.pulsant.co.uk
* extras: centos.serverspace.co.uk
* updates: mirror.sov.uk.goscomb.net
Resolving Dependencies
--> Running transaction check
---> Package yarn.noarch 0:0.22.0-1 will be installed
--> Processing Dependency: nodejs for package: yarn-0.22.0-1.noarch
--> Finished Dependency Resolution
Error: Package: yarn-0.22.0-1.noarch (yarn)
Requires: nodejs
I do have nodejs installed, but it was not done via yum
[root@default-centos-7 ~]# node -v
v6.5.0
[root@default-centos-7 ~]# nodejs -v
v6.5.0
[root@default-centos-7 ~]# npm -v
3.10.3
What is the expected behavior?
I would expect it to see the nodejs installation and install the package
Please mention your node.js, yarn and operating system version.
Centox 7.2
Node 6.5.0
Yarn N/A
Hmm... Do RPM packages have some method of "recommending" another package? Rather than having a hard dependency on the nodejs package, we could just "recommend" it (this is what we do for the Debian package). This would allow you to install it even without a nodejs package.
Alternatively, could you switch to installing Node.js via RPM package? Generally that's the cleaner solution :)
Do RPM packages have some method of "recommending" another package?
Tbh, I'm not sure, but that would be great if that could be done
Alternatively, could you switch to installing Node.js via RPM package? Generally that's the cleaner solution :)
While you are correct, we are creating a chef script that allows us to set the specific version of node we want installed. I've been looking around to see if we can install specific version via yum but I'm having trouble finding anything. Seems like we'd need to install from a binary or source to get a specific version.
Any advice would be great if you have it
I ended up just copying the file from https://yarnpkg.com/latest.tar.gz, unpacking it, and symlinking it. seems to be more of a workaround though
I've hit this as well, when using nvm on centos
@Daniel15 RPM packages can Recommend other packages in versions since 4.12.0 Release Notes Here however Centos7 and RHEL7 still run 4.11.3 (in the lastest RHEL7.4 beta) so Recommends don't work. Although you could always package up and el* and fc* version of yarn and include in the fpm call --rpm-tag "Recommends: ..." in the fc* version and --rpm-tag "Requires: ....." in the el version, or just don't add anything to the EL version if it really is a non-mandatory dependency.
it seems to me that even in 4.12.0, rpm only supports query recommends; you still won't be able to skip those weak dependencies when installing a package
as far as I can see, unzip the yarn tarball and do a symbolic link seems to be the only walkaround if you have to run a specific version of node
FWIW i hit this on nvm+centos and my solution was to just not use the install script/yarn. doing npm i -g yarn worked
Got the same issue when installing node with software collection (rh-nodejs10)
Error: Package: yarn-1.16.0-1.noarch (yarn)
Requires: nodejs
Got the same issue, and I perfer to install nodejs manually so that I can easily use n module to manage node version.
Saw this pop up again, I'd have to question if having nodejs installed is really a dependency of yarn.
I mean, yes, yarn won't run if there's no nodejs installed anywhere. But yarn itself is useful as a package regardless of how it finds nodejs.
Where I've been forced by policies to use RPM's for any permanent software install but have also wanted to use multiple scl versions of nodejs (where yarn appears as thought it would work totally fine because your path and environment are updated when you scl enable a nodejs package) I've needed to build a separate rh-nodejs8-node-yarn rh-nodejs10-nodejs-yarn, etc. Packages just to make the dependencies line up nicely, only to later realise that I could totally have just built my own yarn rpm without the Requires: nodejs bit and just installed that everywhere...
Feels like it should just be a removed dependency.
Feel free to send a pull request that removes the dependency, if you feel like that's the best approach.
Had the same issue in CentOS.
Installed nodejs using "nvm" and got this issue while installing yarn.
Resolved by installing yarn via npm. "npm install yarn --g"
Most helpful comment
FWIW i hit this on nvm+centos and my solution was to just not use the install script/yarn. doing
npm i -g yarnworked