OSC / ood-fileexplorer

[MOVED] The Open OnDemand File Explorer
https://osc.github.io/Open-OnDemand/
MIT License
4 stars 1 forks source link

Try using yarn for package management #151

Closed ericfranz closed 7 years ago

ericfranz commented 7 years ago

On a branch try these things:

  1. npm install yarn as a local development dependency for your user account (similar to how we installed bower for the wiag user) https://yarnpkg.com/en/
  2. specify dependencies using yarn package manager
  3. commit the dependencies to the repo (since yarn ensures that no matter who you are or where you are the same lock file will install the same dependencies in the same order
  4. verify that you can "install" the app with this version without having yarn available and without running any npm install or yarn install step (because the assets are already compiled with the app

If these work, then yarn becomes a development dependency, but not an installation dependency, and we can safely use this package manager instead of npm for node.js apps.

We have been bit too often with dependency updates breaking the app, even when we think we have "locked" dependencies using shrinkwrap. Its obvious that npm shrinkwrap does not work and is not reliable like Gemfile.lock is in Ruby.

nickjer commented 7 years ago

You can't. Our node is too old.

ericfranz commented 7 years ago

So we can and should install yarn manually (via rpm or "Manual Install via tarball") instead of using npm. Have you confirmed that once yarn is installed, it still will not work with our older version of node?

ericfranz commented 7 years ago

Reference for my comment: https://yarnpkg.com/en/docs/install#alternatives-tab

ericfranz commented 7 years ago
efranz@webtest04:~/yarn/bin$ ./yarn
Node version 0.10.40 is not supported, please use Node.js 4.0 or higher.

There it is.

ericfranz commented 7 years ago

https://www.softwarecollections.org/en/scls/rhscl/rh-nodejs4/ but only for RHEL7.

I wonder the Node 4 requirement by yarn is only for yarn to be able to run. Could I use node 4 and yarn to manage dependencies for a node 0.10.40 app?

ericfranz commented 7 years ago

node 4 is now available for RHEL 6 & 7

ericfranz commented 7 years ago

rh-ror42 and rh-ruby23 and rh-nodejs4 all "go together". ironically though, https://www.softwarecollections.org/en/scls/rhscl/rh-ror42/ and https://www.softwarecollections.org/en/scls/rhscl/rh-nodejs4/ are both listed as supported in both RHEL 6&7 but https://www.softwarecollections.org/en/scls/rhscl/rh-ruby23/ is listed as only supported in RHEL7