Giter VIP home page Giter VIP logo

npm-shrinkwrap-install's Introduction

npm-shrinkwrap-install

Automatic synchronise shrinkwrap file with package install/update/uninstall.

Install

$ npm install npm-shrinkwrap-install -g

This is a CLI-only package (for now).

Require Node.js >= 0.11, or iojs >= 1.0

Usage

Install/Update a package

$ npm-install babel@latest --save

You could manually alter the version in package.json and run npm-install as well.

Notice:

Before updating shrinkwrap, the script will try to verify node_modules content with your package.json. Which means:

  • Any package not included in dependencies will be pruned. So it is mandatory to use --save when installing new packages.
  • Any package with non-strict version description (^, ~, 0.2.x, *, latest) in package.json will be updated. If you which to opt out this automatical update check, just use a strict version like 0.2.3.

Uninstall a package

$ npm-uninstall babel --save

Shrinkwrap file will be automatically in sync with your dependencies in package.json.

Notice:

If --save is omitted, the script will generate an error since node_modules content does not agree with your package.json.

Create shrinkwrap file manually

$ npm-shrinkwrap

Commands and Aliases

Install

npm-install npm-i

Accepts all arguments for npm install

Uninstall

npm-uninstall npm-un npm-remove npm-rm npm-r

Accepts all arguments for npm uninstall

Shrinkwrap

npm-shrinkwrap

Accepts all arguments for Uber's npm-shrinkwrap

Credit

This script is largely based on Uber's npm-shrinkwrap. At the time of the writing, their tool does not support scoped package. A pull-request is created to rectify this issue and yet to be accepted.

As a temporary measure, I've forked their project and applied my patch to support scoped package: @th507/npm-shrinkwrap. npm-shrinkwrap-install is currently dependent upon @th507/npm-shrinkwrap.

License

Copyright (c) 2015 Jingwei "John" Liu

Licensed under the MIT license.

npm-shrinkwrap-install's People

Contributors

th507 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

xuqinggang

npm-shrinkwrap-install's Issues

TypeError: Cannot convert undefined or null to object

$  npm-r some-package --save
TypeError: Cannot convert undefined or null to object
    at Function.keys (native)
    at diff (/Users/ahogan/.nvm/versions/node/v5.7.1/lib/node_modules/npm-shrinkwrap-install/lib/diff-deps.js:4:28)
    at /Users/ahogan/.nvm/versions/node/v5.7.1/lib/node_modules/npm-shrinkwrap-install/bin/install.js:30:21
    at process._tickCallback (node.js:406:9)

some-package (not the real name) is in my package.json and is currently installed.

Any idea what’s up here? Is npm-shrinkwrap-install compatible with node 5.7?

Getting dependency error when trying to install

$ npm install npm-shrinkwrap-install -g
$ npm ERR! Darwin 15.6.0
$ npm ERR! node v6.9.4
$ npm ERR! npm  v3.10.10
$ npm ERR! code E404
$ 
$ npm ERR! 404 no such package available : @th507/npm-shrinkwrap
$ npm ERR! 404
$ npm ERR! 404  '@th507/npm-shrinkwrap' is not in the npm registry.
$ npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
$ npm ERR! 404 It was specified as a dependency of 'npm-shrinkwrap-install'
$ npm ERR! 404
$ npm ERR! 404 Note that you can also install from a
$ npm ERR! 404 tarball, folder, http url, or git url.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.