I am trying to publish my first module to NPM, it renders markdown with EJS templating, it uses two other npm modules marked and ejs, I have these as dependencies in my package.json
file. I have a .gitignore
file that contains my node_modules
directory, and also a .npmignore
file that is empty.
I have successfully published to npm.
However when I try to install my module by putting it into the package.json
of a test app and doing npm install -d
it installs, but it does not install its dependencies, if I go into the test app root node_modules
directory and then into my newly published module's installed directory, It has not installed any of its dependencies, it has not have a nested node_modules
directory of its own.
There should be a way to get my module's dependencies to install with it correct, when I include express as a dependency, it installs its own node_modules folder with connect and other modules installed, I want to do the same with two other npm modules.
I know it would work if it would install its nested node_modules
dependencies, when I do this it works.
$ npm install -d
$ cd node_modules/my_module
$ npm install -d
$ cd ../..
$ node app
EDIT: Here is a link to the GitHub repo for my module, and here is the package.json.
EDIT: Note, this has only happens when I had my dependencies marked and ejs already installed in my test app. When I then installed my module, it did not install marked and ejs in its own node_modules
directory. However, if I remove all modules from the test app and install only my module, it will install them. Is there anyway to get it to work regardless of whether my dependencies have been installed beforehand.