Page MenuHomePhabricator

Use system-wide ws nodeJS module
Closed, WontfixPublic

Description

According to https://secure.phabricator.com/book/phabricator/article/notifications/#installing-node-and-modu, NodeJS module ws is needed to be installed in directory

support/aphlict/server/

when it would be really great to be able to use the system-wide one to help getting assistance of package manager to get the lastest/safest and/or usable by every instance you have.

Event Timeline

beber raised the priority of this task from to Needs Triage.
beber updated the task description. (Show Details)
beber added a project: Aphlict.
beber added a subscriber: beber.
epriestley claimed this task.
epriestley added a subscriber: epriestley.

http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation

Just like how global variables are kind of gross, but also necessary in some cases, global packages are important, but best avoided if not needed.
In general, the rule of thumb is:
If you’re installing something that you want to use in your program, using require('whatever'), then install it locally, at the root of your project.

So we are not really unable to rely on a packager manager for such ?

Ironically for the docker image I built, it has to install WS from the system package manager because NPM doesn't work right. On boot it then copies the globally installed ws underneath the server folder.

(I believe this is because NPM tries to compile some native code during installation, and for whatever reason, linking fails because of library versioning)

To copy the globally installed modules, I run the following on boot in the docker image:

cp -Rv /usr/lib/node_modules /srv/phabricator/phabricator/support/aphlict/server/
chown -Rv git:wwwgrp-phabricator /srv/phabricator/phabricator/support/aphlict/server/node_modules