Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

A client 'npm verify' would be handy to have available #1213

Closed
ctide opened this Issue · 5 comments

7 participants

Chris Burkhart Thomas Muldowney Jann Horn isaacs Dan Shaw Florian Margaine Luke Arduini
Chris Burkhart

We have an open source project that consistently has non-node people running into issues such as :

LockerProject/Locker#127

Which is due to lack of familiarity with npm and node in general. It would be nice if we had an easy way in our startup script to just check if there are any unmet dependencies currently, and then prompt the user to run npm install to resolve that before trying to start their locker.

Thanks!

Thomas Muldowney

+1

Jann Horn thejh referenced this issue from a commit in thejh/npm
Jann Horn thejh #1213: add "checkdeps" command 3a1194f
Jann Horn

If my pull request #1279 gets pulled, you can do this:

var npm = require("npm");
npm.load({}, function() {
  npm.commands.checkdeps([], true, function(err, result) {
    if (err) throw err;
    if (!result) {
      // unmet dependencies
    }
  }
});
isaacs
Owner

@thejh Commented in the pull request a bit.

I think it'd be better to maybe have a few things done by a "verify" command:

  1. Make sure that any "bin" and "main" files exist.
  2. Validate that the dependencies are installed.
  3. Make sure that there are no bundledDependencies that aren't listed as dependencies.
  4. Make sure that there's a test script, and run tests, and make sure that they pass.
  5. Add the package to the cache, and verify that the tarball is not huge (say, assert that it's less than 50Mb)
Dan Shaw

+1 I prefer the semantic of npm verify over npm checkdeps from #1279.

Will Elwood welwood08 referenced this issue from a commit in welwood08/npm
Jann Horn thejh #1213: add "checkdeps" command 5ed2681
Florian Margaine

This issue should be closed; its pull request was closed by isaacs 5 months ago.

Luke Arduini luk- closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.