kalisio/feathers-distributed

ERROR install if npm uuid package is already a dependency

corepay opened this issue · 6 comments

Steps to reproduce

  1. Fresh feathers install
  2. Add npm uuid package -> yarn dev server starts
  3. Add @kalisio/feathers-distributed -> yarn dev error below in image.
  4. remove uuid, node_modules and yarn.lock the rebuild dependencies -> server starts fine
  5. Add uuid and restart -> error below.

uuid updated their imports a couple months ago. Looks to me like distributed feathers is trying to require uuid the old way on the new uuid package if it already exists node_modules.

image

error here /@kalisio/feathers-distributed/lib/index.js

common js require for v4 === const { v4: uuidv4 } = require('uuid');

image

server starts if I make the following change but not sure yet if this is going to jack anything else up in your package.

image

nope -> now looking for v2 uuid. I'll wait for you to take a look and straighten out the uuid dependencies...over my head already.

image

I removed the uuid and replaced with uuid-random in my project. all looks good now so I can move on. uuid-random looks to be a lot faster than uuid and has the same syntax you are using without requiring a module like uuid does now. Could be a good, quick replacement for your library.

image

It seems to me that you are creating a version conflict by adding the uuid package in a different version than we are using. As they changed the interface (breaking change) you need to stick to our version if you don't want things to break. I guess that running yarn add uuid@3.2.1 (version of our lock file) or using a resolution should fix it.

Anyway, I can we can also easily upgrade the uuid package to e newer version, it's only used when initializing an app to get a unique ID, we don't have any performance issue here.