Bug 1125870
Summary: | NODE_PATH is not set, and node won't find modules installed systemwide by yum/rpm | ||
---|---|---|---|
Product: | [Fedora] Fedora EPEL | Reporter: | Jan Kundrát <jkt> |
Component: | nodejs | Assignee: | T.C. Hollingsworth <tchollingsworth> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | el6 | CC: | jamielinux, mrunge, sgallagh, tchollingsworth, thrcka |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-08-01 20:43:23 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Jan Kundrát
2014-08-01 09:33:28 UTC
This is a deliberate design decision by node and npm upstream which Fedora respects. For more information on why, see: https://www.npmjs.org/doc/faq.html#I-installed-something-globally-but-I-can-t-require-it Our packaging guidelines are intended to ensure that RPM-provided modules work exactly like ones installed by `npm install -g`, and can be used in local modules easily using `npm link`. You can also set NODE_PATH=/usr/lib/node_modules in your environment to make npm and rpm installed modules available universally. This is also documented here: https://fedoraproject.org/wiki/Node.js#Using_modules_installed_via_yum Your third-party module likely ships a package.json file in the root of the module that expresses its dependencies. You can simply invoke `npm install` in that directory and npm will read the dependencies from that file and create a node_modules directory and install all dependencies inside it. This is the reccomended way to get dependencies for third-party applications since we cannot guarantee that the versions of packages provided as RPMs match the dependency set of your third-party application. (Especially in EPEL, where many nodejs packages are relatively outdated due to EPEL's stablility and lifetime guarantees.) Oops, I wasn't aware of the upstream's decision -- that comes as a surprise to me. I was googling for stuff like "node won't find system-wide modules", but I hadn't included the keyword "npm" in there. I also landed on Fedora's feature page about a proposal to package Node.js IIRC, but not on that present status page (or I missed it, don't know anymore). Either way, sorry for wasting your time, and thanks for an excellent response. (In reply to Jan Kundrát from comment #2) > Oops, I wasn't aware of the upstream's decision -- that comes as a surprise > to me. I was googling for stuff like "node won't find system-wide modules", > but I hadn't included the keyword "npm" in there. I also landed on Fedora's > feature page about a proposal to package Node.js IIRC, but not on that > present status page (or I missed it, don't know anymore). Yeah, I think that feature page has more Google juice because marketing materials and news organizations linked to it quite a bit during the Fedora 19 release cycle where we first introducted Node.js to Fedora. :-( I just added a little note to the top of that old page now directing people to the new one with more up-to-date information. Hopefully that will help people in the future. > Either way, sorry for wasting your time, and thanks for an excellent > response. No trouble at all. :-) |