Docker, Nodejs and File based modules

I have a project - an adonis based website, and part of that site is a provider. As I’m still working on it, I use the following to add the reference :

npm install path/to/provider

and this sets up a dependancy in my package.json file like this :

"Provider": "file:path/to/provider"

On the container, I can see that Provider folder in the node_modules folder (ls -l shows it linking to the correct path on the file system) - so it all looks good.

but when I launch node, and issue a

let t = require('Provider')

and I get the following error :

{ Error: Cannot find module 'Provider'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
    at Function.Module._load (internal/modules/cjs/loader.js:506:25)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18) code: 'MODULE_NOT_FOUND' }

I can reference other modules in the package.json - but this fails to load.

Node version : v10.13.0
npm version : v6.4.1

and - to quote to oft repeated phrase : It works on my machine (Windows + WSL with Node v10.13.0)

Any ideas - I’m totally stumped.

I’m going to add this here as I did eventually figure out what was going on.

My module was missing a root index.js file. I added the missing index.js file, and linked it all in and it worked.