{"id":19621312,"url":"https://github.com/commenthol/offline-npm","last_synced_at":"2025-04-28T03:32:16.386Z","repository":{"id":19615583,"uuid":"22866999","full_name":"commenthol/offline-npm","owner":"commenthol","description":"hasslefree npm pack including all dependencies for offline installation with npm install","archived":false,"fork":false,"pushed_at":"2016-09-14T19:55:14.000Z","size":45,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-18T23:19:20.752Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/commenthol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-12T06:21:12.000Z","updated_at":"2020-04-18T15:35:57.000Z","dependencies_parsed_at":"2022-08-24T03:00:15.025Z","dependency_job_id":null,"html_url":"https://github.com/commenthol/offline-npm","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Foffline-npm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Foffline-npm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Foffline-npm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Foffline-npm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commenthol","download_url":"https://codeload.github.com/commenthol/offline-npm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251246234,"owners_count":21558761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T11:22:19.310Z","updated_at":"2025-04-28T03:32:15.671Z","avatar_url":"https://github.com/commenthol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# offline-npm\n\n\u003e **npm \u003e= v3.x bundled with node \u003e= v5** has **[broken](https://github.com/npm/npm/issues/10379)** this project.   \n\u003e `preinstall` script is since then called after requests to npm registry are made.  \n\u003e This makes it impossible for `offline-npm` to start as a registry server.  \n\u003e See [BROKEN.md](BROKEN.md) for detailed logs.  \n\nHassle-free `npm pack` including all dependencies for offline installation with `npm install`\n\nAdd `offline-npm` to your project to serve a npm compatible tgz file wich contains all dependencies for offline installation with `npm install`.\n\nAdditionally you can use `offline-npm -n` to install packages from your local npm cache directory (Could be useful e.g. on travelling).\n\nEven installs using `git:` or `file:` (requires node\u003e=0.11) are considered.\n\n## Table of Contents\n\n\u003c!-- !toc (minlevel=2 omit=\"Table of Contents\") --\u003e\n\n* [Installation](#installation)\n* [Usage](#usage)\n* [Tutorial](#tutorial)\n* [Install packages from npm cache offline](#install-packages-from-npm-cache-offline)\n* [Troubleshooting](#troubleshooting)\n* [License](#license)\n\n\u003c!-- toc! --\u003e\n\n## Installation\n\n    npm install -g offline-npm\n\n\n## Usage\n\n1. Open terminal and go to your project you want to prepare for offline use.\n   This folder needs to contain a `package.json` file.\n\n2. Prepare your project for offline use\n\n        offline-npm --add\n\n   This changes the `package.json` file and adds a `offline` folder which will contain all your dependencies.\n\n3. Pack your project\n\n        npm pack\n\n   Now the local cache is changed and all your projects dependencies will be downloaded into `offline/cache` and packed into the npm tgz file.\n\n   \u003e __Note__: Take care not to add a global `*.tgz` into your `.npmignore` file!\n\n   \u003e __Note__: An existing `npm-shrinkwrap.json` file will get overwritten in this step to provide install without the `--registry` switch. A backup is stored in the `./offline` folder.\n\n4. Transfer the resulting `\u003cname\u003e-\u003cversion\u003e.tgz` from the pack command onto a machine with no connectivity to the required registry. Execute this line from a terminal.\n\n   Now install the package with:\n\n        npm install [-g] \u003cname\u003e-\u003cversion\u003e.tgz\n\n\n## Tutorial\n\nFind [here](TUTORIAL.md) a step-by-step [tutorial](TUTORIAL.md) using a provided sample project.\n\n\n## Install packages from npm cache offline\n\nIf you want to use your local npm cache to install packages from use the option\n\n    offline-npm -n [-d]\n\n\u003e `-d` shows you some server logs on the console.\n\nThen install packages from the local npm cache with:\n\n    npm --registry http://localhost:4873 [-f] install \u003cpackagename\u003e\n\n\u003e Use the `-f` switch to force installing packages. This might be required if `npm` stops stating \"shasum\" errors.\n\n## Troubleshooting\n\n1. Never add `*.tgz` into your `.npmignore` file. Otherwise all `package.tgz` files for the offline installation will be missing.\n\n   If you want to exclude previously packed versions of the package you're working with use `\u003cname\u003e-*.tgz` instead.\n\n2. The script needs access to `npm`. It is assumed that `npm` is installed alongside with `node`. If you experience problems with correcty resolving `npm`, add to your `$HOME/.profile` or `$HOME/.bashrc`\n\n        export NODE_PATH=\u003cpath_to_node_modules\u003e/node_modules:$NODE_PATH\n\n   where `\u003cpath_to_node_modules\u003e` is the path to the `node_modules` dir which contains npm.\n\n3. If installation hangs try installing in verbose mode\n\n        `npm install \u003cname-version\u003e.tgz --verbose`\n\n   If you see that some `.lock` in your files block you from progress, consider deleting them with `npm cache clean \u003cpkg\u003e[@\u003cversion\u003e]`\n\n\n## License\n\nCopyright (c) 2014 commenthol\n\nSoftware is released under [MIT][MIT].\n\n[MIT]: ./LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Foffline-npm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommenthol%2Foffline-npm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Foffline-npm/lists"}