2
votes

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.

3
Did you ever fix the problem?Zheng-rong Cai

3 Answers

0
votes

try remove package.lock file located in clientapp folder i fixed it by removing lock file

0
votes

Try Changing Directory (CD) to the directory where your package.json file is present.

0
votes

The npm error is not good.

Check if you have http proxy set. It blocks the data. Remove or comment proxy from your .gitConfig file. And run it, it will work