I followed this tutorial for Modular programming in nodejs. https://dzone.com/articles/build-your-nodejs-application-in-a-modular-way
I've hard links to specified dependencies under node_modules folder
node_modules/sub1
node_modules/sub2
Warning
The warning is with a submodule that has other subdirectories and when i run npm install
, npm
looks for package.json
in each sub directory.
npm WARN enoent ENOENT: no such file or directory, open '/sub1/controller/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/sub1/model/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/sub1/view/package.json'
Problem/Question:
The dependency for sub1 module is not getting pulled from npm, how to resolve this as well. The dependency is listed within the package.json of the sub1 module.
Attempts
1) .npmignore but it didn't work either.
# ignore all '.js' files, everywhere
*.js
# and every folder
./*
# ...except the .js file that I want to include
# un-ignore that, so it gets included.
!./controller/*
!./model/*
!./view/*
P.S. These dependencies locally exists at my root level of the project and are hard linked to the node_modules folder, just in case if this matters.