Runs npm install at cloned repos directory an array of metadata objects that you can pass to save. Returns a Promise that resolves to report, i.e. This function is curried, so if you provide just options argument you will get a new function that takes only one argument - packages array. Options are also passed to each reinstall call.
Npm install from github tag series#
You can supply this to reinstall_all method.Įxecutes reinstall in series for each package in packages. a package.json) and returns array of objects. Reads list of packages from file at given path (e.g. last matching commit) to the package.json, effectively locking the version of the dependency. With -save option it will write the sha of tha HEAD (i.e. Just like with plain NPM, on the command line you can specify a space separated list of packages to be installed: npm-git install #experimantal-branchĪfter hash you can specify a branch name, tag or a specific commit's sha. You may want to do this if you find it offensive to put non-standard section in your package.json. You can optionally specify different paths for package.json: npm-git install -c git-dependencies.json In effect you will get your dependency properly installed. Then run npm install in your project path.
Which will trigger prepublish hook of the package being installed. This simple script will do the following for every of gitDependencies section of package.json:Ĭlone the repo it into temporary directory npmignore, which will most likely remove all your source files and make it hard to recover. One would expect that running npm install would also run prepublish before installing. some-local-directory/my-package then npm will run prepublish script of the my-package and then install it in current project. Here is relevant issue with ongoing discussion. Because of that some authors are keeping build artifacts in the repos, which I would consider a hurdle at best. It basically prevents us from installing anything that needs a build step directly from git repos. IMO there is a serious defect in current versions of NPM regarding installation process of dependencies from git repositories. Now it should be easy to deploy, as long as the git executable is available in the environment. node_modules/.bin/npm-git install -save is probably the safest option, as it guarantees the same revision to be installed every time. You can also add a dependency and lock it's sha in one go. This will reinstall all git dependencies, but also write last matching commit's sha to package.json, effectively locking the versions. If you want to lock versions of git dependencies, use. Then install your dependencies as usual: npm install
one that you would provide to git clone on command line) - no fancy NPM shortcuts like user/repo or bitbucket:user/repo. NPM allows installation using commit-ish tags on GitHub: npm installObviously replace *-package-name and git URLs with values relevant to your project. Install npm install -save npm-git-install It is meant as a temporary solution until npm/npm#3055 is resolved. Clones and (re)installs packages from remote git repos.