npm - What is the relationship between the node_modules directory and package.json? -


is structure of dependencies in node_modules mirror of dependency tree structure found in package.json? or performing npm install download in package.json , organize node_modules in special way?

ideally package.json correspond node_modules. running npm install (with no arguments) install packages described in package.json node_modules, running npm install somepackage won't modify package.json unless use --save option.

you can use npm list check if node_modules , package.json in sync. packages in package.json aren't in node_modules tagged unmet dependency, whereas packages in node_modules not in package.json tagged extraneous.

also note root package.json doesn't contain full dependency tree; contains list of direct dependencies. dependencies of dependencies listed in package.json files of dependencies themselves, recursively.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -