Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Make sure already installed packages are complete #6913

Closed
iarna opened this issue Dec 12, 2014 · 3 comments
Closed

Make sure already installed packages are complete #6913

iarna opened this issue Dec 12, 2014 · 3 comments
Assignees
Milestone

Comments

@iarna
Copy link
Contributor

iarna commented Dec 12, 2014

That is, currently npm just assumes that the package has all of its dependencies met if its there. It should, in fact, verify this and install anything that's missing.

The multi-stage installer is skipping these too currently, but correcting that should be easy.

See also: #1341, #4956, #3124, #6349, #4037, #5465

@pedramphp
Copy link

#1341 - To me this is really a bug with NPM, at least create a sym link if you don't download dependencies.
in my use case we are loading .less file as an NPM module and we need to reference it from our module. but since the module is NOT downloaded because it is in the parent.
It is failing to work.

@iarna
Copy link
Contributor Author

iarna commented Dec 18, 2014

@pedramphp Your complaint "not installing a module because its installed in a parent" doesn't seem related to this issue? I'm afraid that what you're describing is going to happen MORE by design because of the implicit deduping of #6912. Typically your dependencies won't ever be installed below the current module.

If you're open to other ways of solving your problem, one would be to export their location of your less files (or other non-requireable resources, for example, css, html, images, etc) as a part of your module's interface, like this:

var path = require("path")
exports.lessDir = path.resolve(__dirname, "less-files")

Then things using the module that distributes less files can say:

var path = require("path")
var lessDir = require("my-module").lessDir
var lessFile = path.resolve(lessDir, "my-file.less")

@iarna
Copy link
Contributor Author

iarna commented Mar 26, 2015

Closing this as fixed in npm/npm#multi-stage

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants