Search code examples
npmnpm-installpackage.jsonhandsontable

NPM module (handontable) not installing sub-dependency(numbro) as project dependencies


What I am trying to do: So, I am installing a package which has a dependency numbro (another package). For my use case, I need to use that package and initialize it with some value. (set default currency)

However, I am not able to use that package in my code. As from inspecting package-json.lock, I can see that the package isn't there as direct project dependency but is present inside handontable's dependencies.

I thought, I can add numbro directly inside my package.json file to initialize some values but from what it seems, adding it direct and setting default value there doesn't solves the issue.

To check further, I created a dummy angular project with only handontable and handontable/angular to see, if I can reproduce the issue there. However, after npm install, I could use numbro package in the dummy project and the reason being it was present as direct project dependency in package-json.lock file.

The versions of numbro, handontable, handontable/angular and angular are all same in both projects but why is it that in one project I can use the the sub-dependency in my angular project but in another I cannot ?

Original Project: enter image description here

Dummy Fiddle project: enter image description here (installed as direct project dependency)


Solution

  • So, I fixed it with some help from handsontable support team. I deleted node_modules folder and package-json.lock file both.

    After which npm install did the trick.

    I had tried deleting node_modules folder earlier but doing that alone doesn't resolved the issue.