2

I'm trying to pacakge my node-js application into single rpm-package. The first thing that came to mind: add nodejs and npm as package dependencies.

Requires: node npm

Such rpm worked perfectly on Fedora. But on CentOS rmp installation had been failed on dependency resolution step. The problem is that on CentOS nodejs and npm aren't in default package repository, but they are in EPEL repo. I had tried to add epel-release package to requires, but it didn't help.

So, what's the best option for packaging node-js applications into rpm's? Should I install it from sources instead of from repo? Or this issue with EPEL can be handled?

RomanHotsiy
  • 4,978
  • 1
  • 25
  • 36
  • 1
    Why you'd you want to use RPM the first place? Is there a reason why you don't publish it via the registry? The dependency on EPEL does not work because EPEL will be installed, but since the other requirements are in EPEL, they can't get resolved during installation. However, a single command line like `yum install epel-release && yum localinstall /path/to/your.rpm` isn't asked too much of a user. If you want to have it really convenient, you could provide a bootstrap script. – Markus W Mahlberg Oct 26 '14 at 09:22
  • I totally agree with you, but monolite rpm is requirement from the client. He want "double-click intallation" and no terminals. If I don't find proper solution, I'll try to convince him. – RomanHotsiy Oct 26 '14 at 09:28
  • 1
    A meta package won't help, either. The same problem. What you could do is either having a bootstrap script or a self extracting shell script containing your RPM, which installs epel-release prior to unpacking itself and "localinstalling" the unpacked RPM. another option would be to leave out NPM and node of the requires field and have epel-release, node and npm install by the %preinst script. Ugly hack, but should work. – Markus W Mahlberg Oct 26 '14 at 09:38
  • thanks. self-extracting shell script is very interesting option. – RomanHotsiy Oct 26 '14 at 09:46

2 Answers2

1

Add the EPEL repository to yum in order to satisfy the requirements is the easiest path, particularly if you wish to use Fedora node.js pre-built sources.

You can bundle the EPEL node.js and npm from your own repository. Meanwhile double click install of *.rpm isn't easy (SuSE can do this, just Ick )

Jeff Johnson
  • 2,310
  • 13
  • 23
0

I realize this is an old question, but this might help others. I ran into a similar issue, and I used :

Requires: nodejs

this worked for me in CentOS 6.6

nolimit
  • 814
  • 10
  • 19