Verify that a package will be able to install after it is published.

Usage no npm install needed!

<script type="module">
  import pkgCanInstall from '';



Build Status Greenkeeper badge


Tests if the package in the current working directory can be installed after it is published, that way you won't have to publish another version with a fix.

Table of Contents generated with DocToc


$ npm install --save-dev pkg-can-install

Then edit your package.json to have:

  "scripts": {
    "prepublishOnly": "pkg-can-install"

Then pkg-can-install will be run right before a publish.

How it works

  1. We get a temporary directory
  2. We recursively copy the current package minus node_modules to that directory
  3. We run npm install --production and verify that it works