GithubHelp home page GithubHelp logo

arei / npmbox Goto Github PK

View Code? Open in Web Editor NEW
245.0 245.0 34.0 184 KB

Utility for creating (boxing) and using (unboxing) an archive of a complete (including all dependencies) npm install.

License: MIT License

JavaScript 100.00%

npmbox's People

Contributors

arei avatar danfuzz avatar dfabulich avatar jamiemcconnell avatar jgainfort avatar johnktims avatar letalumil avatar ricksbrown avatar

Stargazers

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

Watchers

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

npmbox's Issues

Issues unboxing/installing

This is happening on my box without internet:
without sudo: Error: EACCESS mkdir '/usr/lib/node_modules' errno: 3
with sudo: Error: getaddrinfo ENOTFOUND

Using 2.6.1

npmbox for phantomjs

I am facing an issue where phantomjs is fetching from CDN at the time of install everytime I build.

You have mentioned the following notes on the issue "npmunbox with multiple packages fails to install all packages ":

"Just a side note unrelated to this ticket, but I'm not sure how effective using npmbox will be with phnatomjs. The npm install process for phantomjs executes an install script that goes out to a CDN to fetch the latest version of phantomjs and stores it on its own. npmbox doesn't know anything about this cdn or the file retrieved from it. When you go to npmunbox phantomjs later, it's still going to make a network connection and try and get the cdn file. That's not really the spirit of npmbox and beyond the scope of what npm can do "

I am running into this exact issue.

Please let me if you have found any workaround for this issue?

Offline installation isn't working

Hi,
I've followd the instructions up to this line:
npm install --global --cache ./.npmbox.cache --optional --cache-min 99999 npmbox
It does something (installs and the npmbox shows in my global node modules), but npmbox isn't working. From cmd I try: npmbox but it is undefined.
Any idea why?

ENOTFOUND when installing karma plugins

I've decided to start a new installation of nodejs in order to avoid 3rd party conflicts that might have been in the old install.
So I'm now using:
Nodejs 0.12 64bit
npm 2.5.1
npmbox 2.1.2
I've installed karma, karma-cli and jasmine itself.
When I try to install karma-requirejs and karma-jasmine I get an error: ENOTFOUND.
It seems like the installation is trying to reach npmjs.org and fails (which is expected on an offline computer :)).
Any solution to this?

EDIT: Here's the install output with -v:

npmunbox -g -v karma-requirejs.npmbox

Unboxing karma-requirejs.npmbox
Unpacking karma-requirejs...
Installing karma-requirejs...
npm verb cache add spec karma-requirejs
npm verb addNamed karma-requirejs@*
npm verb addNameRange registry:https://registry.npmjs.org/karma-requirejs not in flight; fetching
npm verb get https://registry.npmjs.org/karma-requirejs not expired, no request
npm verb addNamed [email protected]
npm verb afterAdd PATH\node_modules\npmbox\.npmbox.cache\karma-requirejs\0.2.2\package\package.json not in flight; writing
npm verb afterAdd PATH\node_modules\npmbox\.npmbox.cache\karma-requirejs\0.2.2\package\package.json written
npm info install [email protected] into C:\Program Files\nodejs
npm info installOne [email protected]
npm verb installOne of karma-requirejs to C:\Program Files\nodejs not in flight; installing
npm verb lock using PATH\node_modules\npmbox\.npmbox.cache\_locks\karma-requirejs-2d99a2e09f7cbe83.lock for C:\Program Files\nodejs\node_modules\karma-requirejs
npm verb unbuild node_modules\karma-requirejs
npm info preuninstall [email protected]
npm info uninstall [email protected]
npm verb unbuild rmStuff [email protected] from C:\Program Files\nodejs\node_modules
npm info postuninstall [email protected]
npm verb gentlyRm vacuuming C:\Program Files\nodejs\node_modules\karma-requirejs
npm verb tar unpack PATH\node_modules\npmbox\.npmbox.cache\karma-requirejs\0.2.2\package.tgz
npm verb tar unpacking to C:\Program Files\nodejs\node_modules\karma-requirejs
npm verb gentlyRm vacuuming C:\Program Files\nodejs\node_modules\karma-requirejs
npm info preinstall [email protected]
npm verb about to build C:\Program Files\nodejs\node_modules\karma-requirejs
npm info build C:\Program Files\nodejs\node_modules\karma-requirejs
npm verb linkStuff [ true,
npm verb linkStuff   'C:\\Program Files\\nodejs\\node_modules',
npm verb linkStuff   true,
npm verb linkStuff   'C:\\Program Files\\nodejs\\node_modules' ]
npm info linkStuff [email protected]
npm verb linkBins [email protected]
npm verb linkMans [email protected]
npm verb rebuildBundles [email protected]
npm info install [email protected]
npm info postinstall [email protected]
npm WARN package.json [email protected] Non-dependency in bundleDependencies: inherits
npm verb already installed skipping karma@>=0.9 C:\Program Files\nodejs
npm verb cache add spec requirejs@~2.1
npm verb addNamed requirejs@>=2.1.0 <2.2.0
npm verb addNameRange registry:https://registry.npmjs.org/requirejs not in flight; fetching
npm verb request uri https://registry.npmjs.org/requirejs
npm verb request no auth needed
npm info attempt registry request try #1 at 18:19:12
npm verb request id 5eb45e7b365f4ade
npm http request GET https://registry.npmjs.org/requirejs
npm verb unlock done using PATH\node_modules\npmbox\.npmbox.cache\_locks\karma-requirejs-2d99a2e09f7cbe83.lock for C:\Program Files\nodejs\node_modules\karma-requirejs
  { [Error: getaddrinfo ENOTFOUND] code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo' }

npmbox --help has incorrect long arguments and description text.

The output of npmbox --help has two issues:

First, an incorrect description for the -s option. It presently says "Shows additional output which is normally hidden," and should instead say something to the opposite effect, such as "Suppresses all output" or similar, as appropriate (I don't know, it might still print errors).

Second, the -silent and -verbose long-form options should read --silent and --verbose, with two dashes each.

Thanks for your work!

Allow global installs from npmunbox

Allow for -g or --global to be passed from npmunbox to the underlying npm install command that npmunbox executes.

For that matter, allow ALL switches that are not actively used by npmunbox to be passed to the npm install command.

Seems to have trouble working with tfs-cli

tfs-cli is the TFS cross platform client. Microsoft abandoned tf.exe to use tfx commands via node. Unfortunately , many environments prevent internet access or mess with it. npmbox sounds like the perfect solution for this; however it seems to fail when unboxing.

Steps:

  1. Install tfs-cli:
    npm install -g tfx-cli
  2. run npmbox tfs-cli
  3. uninstall tfs-cli
    npm uninstall -g tfx-cli
  4. attempt reinstall:
    npmunbox tfs-cli.nomunbox

The failure occurs with a path reference.

Does not work when executed with sudo

The command line is doing some funky stuff to determine the arguments and this is causing funky problems when executing from sudo. Suggest changing to one of the third party arguments packages.

npmbox installs a different version than what's in the npmbox file

I have jasmine-reporter 0.2.1 npmbox.

Using npmunbox I get:

[rgolbeck:~/tmp/npm-2]$ npmunbox -v jasmine-reporters.npmbox
Extracting archive jasmine-reporters...
Installing jasmine-reporters...
npm http GET https://registry.npmjs.org/jasmine-reporters
npm http 200 https://registry.npmjs.org/jasmine-reporters
npm http GET https://registry.npmjs.org/jasmine-reporters/-/jasmine-reporters-2.0.0.tgz
npm http 200 https://registry.npmjs.org/jasmine-reporters/-/jasmine-reporters-2.0.0.tgz
npm http GET https://registry.npmjs.org/mkdirp
npm http 200 https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz
npm http 200 https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz
[email protected] node_modules/jasmine-reporters
└── [email protected]

Cleaning Up...

npmunbox installed...
jasmine-reporters

And then jasmine version 2.0.0 is installed instead of version 0.2.1. This apparently started happening yesterday around 16:30 PT.

install npmbox on offline windows7 system fail

npm install --global --cache ..npmbox.cache --optional --cache-min 99999 --shrinkwrap false npmbox
error
0 info it worked if it ends with ok
1 verbose cli [ 'D:\Program Files\nodejs\node.exe',
1 verbose cli 'D:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '--global',
1 verbose cli '--cache',
1 verbose cli '..npmbox.cache',
1 verbose cli '--optional',
1 verbose cli '--cache-min',
1 verbose cli '99999',
1 verbose cli '--shrinkwrap',
1 verbose cli 'false',
1 verbose cli 'npmbox' ]
2 info using [email protected]
3 info using [email protected]
4 verbose install initial load of C:\Users\Administrator\AppData\Roaming\npm\package.json
5 verbose readDependencies loading dependencies from C:\Users\Administrator\AppData\Roaming\npm\package.json
6 silly cache add args [ 'npmbox', null ]
7 verbose cache add spec npmbox
8 silly cache add parsed spec Result {
8 silly cache add raw: 'npmbox',
8 silly cache add scope: null,
8 silly cache add name: 'npmbox',
8 silly cache add rawSpec: '',
8 silly cache add spec: 'latest',
8 silly cache add type: 'tag' }
9 silly addNamed npmbox@latest
10 verbose addNamed "latest" is being treated as a dist-tag for npmbox
11 info addNameTag [ 'npmbox', 'latest' ]
12 silly mapToRegistry name npmbox
13 silly mapToRegistry using default registry
14 silly mapToRegistry registry https://registry.npmjs.org/
15 silly mapToRegistry data Result {
15 silly mapToRegistry raw: 'npmbox',
15 silly mapToRegistry scope: null,
15 silly mapToRegistry name: 'npmbox',
15 silly mapToRegistry rawSpec: '',
15 silly mapToRegistry spec: 'latest',
15 silly mapToRegistry type: 'tag' }
16 silly mapToRegistry uri https://registry.npmjs.org/npmbox
17 verbose addNameTag registry:https://registry.npmjs.org/npmbox not in flight; fetching
18 verbose request uri https://registry.npmjs.org/npmbox
19 verbose request no auth needed
20 info attempt registry request try #1 at 11:35:35
21 verbose request id 0814347d078485a0
22 http request GET https://registry.npmjs.org/npmbox
23 info retry will retry, error on last attempt: Error: getaddrinfo ENOENT registry.npmjs.org:443
24 info attempt registry request try #2 at 11:35:45
25 http request GET https://registry.npmjs.org/npmbox
26 info retry will retry, error on last attempt: Error: getaddrinfo ENOENT registry.npmjs.org:443
27 info attempt registry request try #3 at 11:36:45
28 http request GET https://registry.npmjs.org/npmbox
29 verbose stack Error: getaddrinfo ENOENT registry.npmjs.org:443
29 verbose stack at Object.exports._errnoException (util.js:873:11)
29 verbose stack at errnoException (dns.js:32:15)
29 verbose stack at GetAddrInfoReqWrap.onlookup as oncomplete
30 verbose cwd E:\auto\box
31 error Windows_NT 6.1.7601
32 error argv "D:\Program Files\nodejs\node.exe" "D:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "--global" "--cache" "..npmbox.cache" "--optional" "--cache-min" "99999" "--shrinkwrap" "false" "npmbox"
33 error node v4.4.7
34 error npm v2.15.8
35 error code ENOENT
36 error errno ENOENT
37 error syscall getaddrinfo
38 error enoent getaddrinfo ENOENT registry.npmjs.org:443
38 error enoent This is most likely not a problem with npm itself
38 error enoent and is related to npm not being able to find a file.
39 verbose exit [ 1, true ]

Unable to install gulp.npmbox from gulp

Hello, can I install gulp in Windows 7 with offline environment with npmbox?

I can install other package except this one, the error message is : Unable to install gulp.npmbox from gulp.

Thanks in advance.

not support windows?

Windows 7 x64
npm 1.4.28
node 0.10.33

error when install npmbox from the .npmbox-cache, the output log looks like:
npm ERR! not a package C:\Users.....\tmp.tgz

TypeError: Invalid non-string/buffer chunk]

I have been trying to npmunbox private-bower and mocha on rhel 6 & 7 with node version v0.12.7 . Does anyone knows what is the issue ? [email protected]

npmunbox private-bower.npmbox

Unboxing private-bower.npmbox...
Unpacking private-bower...
[TypeError: Invalid non-string/buffer chunk]

Same error with mocha
npmunbox mocha.npmbox

Unboxing mocha.npmbox...
Unpacking mocha...
[TypeError: Invalid non-string/buffer chunk]

tar preservers permissions when creating .npmbox files

By default tar files have their file permissions (permissions, owner, group, etc) preserved inside the tar file. In most npmunbox operations, these are ignored and the users umask is used instead. However, when npmunbox is run as root or as sudo, permissions are restored which can make the .npmbox-cache folder have incorrect permissions and lead to a EACCS error.

In order to address this, we need to pass more properties into the tar command to prevent permissions being stored when creating the .npmbox file. Or we have to prevent permissions from being restored when performing the untar operation.

Unfortunately, this will involve changing our usage of tar.gz since it does not support such fidelity, or modifying tar.gz so it does.

npm3 compatible installations?

I'm currently running Node.js 5.0 with NPM 3.3.6. If I run "npmbox some-package" and then "npmunbox some-package.npmbox", it appears that the installation process still installs everything in the old nested node_modules style.

Skimming the code, it appears that npmbox uses NPM programmatically. Is there a particular reason why this doesn't install in the newer deduped packages layout? Any ideas for how to make that happen?

Unboxing multiple npmbox files at once fails.

Whenever I attempt to unbox multiple npmbox archives with a single command:

npmunbox jshint.npmbox adm-zip.npmbox browserify.npmbox ... etc

Locker.js is throwing what appears to be a permissions error.

Unboxing ../adm-zip.npmbox...
Unpacking ../adm-zip...
Installing ../adm-zip...
[project path]/node_modules/npmbox/node_modules/npm/lib/utils/locker.js:64
    throw new Error(
          ^
Error: Attempt to unlock [project path]/node_modules/adm-zip, which hasn't been locked

However, simply unboxing each archive one at a time appears to work fine:

npmunbox jshint.npmbox && npmunbox adm-zip.npmbox && npmunbox browserify.npmbox ... etc

I've seen several similar reported failures in npm due to permission errors, however I've tried every combination of permissions on the archives I can think of. I also can't explain why the process only fails if multiple archives are being unboxed at once but works fine if each is unboxed separately.

This isn't a deal breaker, but it makes it much harder to load a lot of thirdparty libraries because a simple
npmunbox *.npmbox
fails. So the build script must be aware of every third party dependency path, which is nasty.

Feature request: npmunbox --install command

Feature request: an npmunbox --install <path> command.

Our situation:

We are offline, but with access to online machines for initial grabbing of .npmbox files.

I have a project that I just pulled down. It has a number of dependencies, listed in package.json.

In a normal, online environment, I could just do npm install and it would install all the dependencies for me.

Using npmbox, I need to do one at a time, and I need to reference package.json to get the complete list.

My suggestion:

An npmunbox --install <path> command, that will install from <path>, the npmboxes of any packages which are specified in package.json.

Why this would be useful:

This would allow us to maintain a network location or USB drive of npmboxes, and allow rapid deployment to new machines.

We have not had great luck with running alternative package managers such as sinopia. Npmbox works well for us, but it is tedious to get a project set up on a new machine.

Thanks!

Unbox installs to ./npmbox.cache and not ./node_modules

I am not sure if I'm doing something wrong, but some modules do not seem to work.
I have installed the npmunbox on my offline machine. If I do:

npmunbox --save require.npmbox then require and all the dependencies are placed into the node_modules and the package.json is updated.

if I try the same thing with webpack,
npmunbox --save webpack or npmunbox --save-dev webpack with or without the .npmbox extension, the command line says "Unpacking.." and then finishes. All the data seems to be going into the .npm-cache folder but then nothing else happens.

I pulled npmbox 26 July 2016, and i'm using Ubuntu 16.04

Cannot untar npmbox.npmbox, even after removing " --no-same-owner --no-same-permissions"

System: Ubuntu 14.04 LTS

After creating npmbox.npmbox, I am trying to untar it (on the same system, just as an experiment). Here is what I get:

alexey:~/npmbox$ tar -xvfz  ./npmbox.npmbox
tar: z: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now

The solution is to remove "z", like this: tar -xvf ./npmbox.npmbox. Then it works. Please fix the documentation .

Unboxing ionic won't work

Hi, I'm trying to work with ionic framework but npmunbox throws an error.

It gives:
Error: getaddrinfo ENOTFOUND registry.npmjs.org
code: ' ENOTFOUND',
errno: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: ' registry.npmjs.org',
parent: 'ionic'

Any idea why this is happening?
Thanks in advance.

npmunbox with multiple packages fails to install all packages

[email protected]

Command:
npmunbox -v [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]

Error:
The first few packages install then I get:
stream.js: 94 throw er; // Unhandled stream error in pipe.
Error: ENOENT, lstat 'some/path/.npmbox-cache/hooker/0.2.3/package/package.json'

Sometimes its chmod instead of lstat.
If I try something a bit simpler like: "npmunbox -v grunt.npmbox phantomjs.npmbox"
It will install one of the packages but not the other with no error.

npmbox fails with Error: EACCES on grunt-recess

[email protected]
[email protected]

Trying to package the following:
npmbox [email protected]
npmbox [email protected]
npmbox [email protected]
npmbox [email protected]
npmbox [email protected]
npmbox [email protected]
npmbox [email protected]
npmbox [email protected]
npmbox [email protected]
npmbox [email protected]
npmbox [email protected]
npmbox [email protected]
npmbox [email protected]
npmbox [email protected]
npmbox [email protected]
npmbox [email protected]
npmbox [email protected]
npmbox [email protected]
npmbox [email protected]

Only npmbox grunt-recess fails with:

Downloading package [email protected]...
npm WARN using --force I sure hope you know what you are doing.
npm http GET https://registry.npmjs.org/grunt-recess
npm http 200 https://registry.npmjs.org/grunt-recess
npm http GET https://registry.npmjs.org/grunt-recess/-/grunt-recess-0.6.1.tgz
npm http 200 https://registry.npmjs.org/grunt-recess/-/grunt-recess-0.6.1.tgz
npm http GET https://registry.npmjs.org/recess
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/chalk
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/maxmin
npm http 200 https://registry.npmjs.org/chalk

npm Error: Error: No compatible version found: chalk@'^0.4.0'
Valid install targets:
["0.1.0","0.1.1","0.2.0","0.2.1","0.3.0","0.4.0"]

Creating archive /user-directory/[email protected]...

/same-user-directory/node_modules/npmbox/node_modules/npm/node_modules/lockfile/lockfile.js:46
throw er
^
Error: ENOENT, lstat '/same-user-directory/.npmbox-cache/007b7e76-recess-1-1-6.lock'

Tried clearing out the npm cache and deleting the npmbox cache but still had this issue. The rest of the packages listed above worked fine. I can also install [email protected] from npm with no problems.

Offline install not working - always trying to connect to npmjs.org

I am having an ENOTFOUND issue installing npmbox on both mac and windows offline machines. I have followed the offline install directions. The connected machine is running npm 2.5 with npmbox 2.1.1 installed. The offline servers are running npm 2.5. Based on the output, it looks like it is trying to hit https://registry.npmjs.org/npmbox. Am I missing something to get it to use the cache directory?

details:
When running sudo npm install --global --cache ./.npmbox.cache --optional --cache-min 99999 --verbose npmbox", here is the output

npm info it worked if it ends with ok
npm verb cli [ 'node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'install',
npm verb cli   '--global',
npm verb cli   '--cache',
npm verb cli   './.npmbox.cache',
npm verb cli   '--optional',
npm verb cli   '--cache-min',
npm verb cli   '99999',
npm verb cli   '--verbose',
npm verb cli   'npmbox' ]
npm info using [email protected]
npm info using [email protected]
npm verb cache add spec npmbox
npm verb addNamed npmbox@*
npm verb addNameRange registry:https://registry.npmjs.org/npmbox not in flight; fetching
npm verb request uri https://registry.npmjs.org/npmbox
npm verb request no auth needed
npm info attempt registry request try #1 at 09:58:54
npm verb request id 3164c309a3269a80
npm http request GET https://registry.npmjs.org/npmbox
npm info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND

npmunbox does not work offline with npm version 1.4.15

Looks like new versions on npm require a connection for install.
Turning off my connection and running npmunbox karma.npmbox results in:

$ npmunbox -v karma.npmbox
Extracting archive karma...
Installing karma...
info trying registry request attempt 1 at 11:53:06
http GET https://registry.npmjs.org/karma
info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND
info trying registry request attempt 2 at 11:53:06
http GET https://registry.npmjs.org/karma
info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND
info trying registry request attempt 3 at 11:53:06
http GET https://registry.npmjs.org/karma

Cleaning Up...

npmunbox had the following errors...
Unable to install karma.npmbox from karma

Fix for offline install untar instructions

There's a note about needing to remove the "f" in the tar command, but the real problem is that "-f" accepts an argument (the filename).

4). Untar the .npmbox file. This will create the .npmbox.cache folder.
      tar -xvfz --no-same-owner --no-same-permissions npmbox.npmbox

This should help:
tar -xvzf npmbox.npmbox --no-same-owner --no-same-permissions

Installing npmbox still reaches out for five packages on offline system

Hey arei, first off I want to say I've really enjoyed using npmbox in the past. Currently I'm trying to upgrade my offline system to npmbox v2.3.1 and:
node v0.12.0
npm v2.5.1
Using Windows 8.1 (reported as Windows_NT 6.3.9600 in the debug)

But as I try to install npmbox with
npm install --global --cache ./.npmbox.cache --optional --cache-min 99999 npmbox
It still reaches out for these five files and fails:
https://registry.npmjs.org/decompress/-/decompress-2.2.1.tgz
https://registry.npmjs.org/npm/-/npm-2.7.1.tgz
https://registry.npmjs.org/is/-/is-3.0.1.tgz
https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz
https://registry.npmjs.org/rimraf/-/rimraf-2.3.2.tgz

Looking through my npmbox.cache, I see those packages except there is a discrepancy with npm-2.7.1.tgz being npm-2.7.3.tgz inside my cache. Yet the npm install process is looking for 2.7.1 and I'm not sure why. What further confounds me is both boxes are running npm v2.5.1.

Any quick fixes for this issue? If I copy those five files over and put them in the correct .npmbox.cache directories with the correct package.json files, will this process work? Or will I likely find more unmet dependencies?

Thank you again!

Add option.save when the unboxing is not global

Right now, unboxing something into a local project doesn't add the dependency to the package.json. This is a bit annoying because it means we have to manually add the dependency to the package.json by going into the module and finding the version number and name.

It seems more proper to add the save option to the npm command when unboxing. I have already hacked this into my own install of npmbox by doing the following in npmunbox.js (starting from line 33):

var options = {
    verbose: argv.v || argv.verbose || false,
    silent: argv.s || argv.silent || false,
    global: argv.g || argv.global || false,
    save: !argv.g || !argv.global || true
};

It would be nice if this could be added in the official package. If necessary, I will make a proper pull request with my change.

Do you need npmbox to unbox a package?

Ok, npmbox can be incredibly useful for us to install npm packages on workstations in a intranet only environment, so where the installer is not able to download any dependancies.

Can you just 'npm install package.npmbox -g' ? Or would we have to extract it first? Because in that case I still have to manually install npmbox and all its dependancies on every workstation. That would be very unfortunate..

And from your todo list: I think it's currently not possible to install npmbox packages globally? When do you think such feature would be available? That would be very helpful for us :)

Thx in advance!
Marcoevich

Unable to box and unbox webpack-dev-server

I'm constantly failing to box and unbox the webpack-dev-server package:

On the online pc I do

npm cache clear
npmobx webpack-dev-server

On the offline pc I do

npm cache clear
npmunbox -g -v webpack-dev-server

This fails. At the end of the very long output it states:

   ...
npm verb about to build C:\Program Files\nodejs\node_modules\webpack-dev-server\node_modules\sockjs-client\node_modules\faye-websocket
npm info build C:\Program Files\nodejs\node_modules\webpack-dev-server\node_modules\sockjs-client\node_modules\faye-websocket
npm info linkStuff [email protected]
npm verb linkBins [email protected]
npm verb linkMans [email protected]
npm verb rebuildBundles [email protected]
npm verb rebuildBundles [ 'websocket-driver' ]
npm info install [email protected]
npm info postinstall [email protected]
npm verb unlock done using C:\Users\mil_epl\Downloads\npmbox\.npmbox.cache\_locks\faye-websocket-f83ec7150e48182e.lock for C:\Program Files\nodejs\node_modules\webpack-dev-server\node_modules\sockjs-client\node_modules\faye-websocket
npm verb about to build C:\Program Files\nodejs\node_modules\webpack-dev-server\node_modules\sockjs-client
npm info build C:\Program Files\nodejs\node_modules\webpack-dev-server\node_modules\sockjs-client
npm info linkStuff [email protected]
npm verb linkBins [email protected]
npm verb linkMans [email protected]
npm verb rebuildBundles [email protected]
npm verb rebuildBundles [ 'debug',
npm verb rebuildBundles   'eventsource',
npm verb rebuildBundles   'faye-websocket',
npm verb rebuildBundles   'inherits',
npm verb rebuildBundles   'json3',
npm verb rebuildBundles   'url-parse' ]
npm info install [email protected]
npm info postinstall [email protected]
npm verb unlock done using C:\Users\mil_epl\Downloads\npmbox\.npmbox.cache\_locks\sockjs-client-c03c9e5429b6b182.lock for C:\Program Files\nodejs\node_modules\webpack-dev-server\node_modules\sockjs-client
npm verb unlock done using C:\Users\mil_epl\Downloads\npmbox\.npmbox.cache\_locks\webpack-dev-middleware-078f47f67604f02c.lock for C:\Program Files\nodejs\node_modules\webpack-dev-server\node_modules\webpack-dev-middleware
npm verb about to build C:\Program Files\nodejs\node_modules\webpack-dev-server
npm verb unlock done using C:\Users\mil_epl\Downloads\npmbox\.npmbox.cache\_locks\webpack-dev-server-a55bb92e72ad2d38.lock for C:\Program Files\nodejs\node_modules\webpack-dev-server
  { [Error: getaddrinfo EAI_AGAIN registry.npmjs.org:443]
  code: 'EAI_AGAIN',
  errno: 'EAI_AGAIN',
  syscall: 'getaddrinfo',
  hostname: 'registry.npmjs.org',
  host: 'registry.npmjs.org',
  port: 443,
  parent: 'webpack-dev-server' }

For some reason it tries to access registry.npmjs.org. Since the last packet in the log is sockjs-client I tired to box and unbox this one explicitely before hand, but that did not change anything.

Any ideas how the npmunbox webpack-dev-server?

Installing npmbox offline yields TypeError: Cannot call method 'replace' of null

I successfully untar'd the npmbox.npmbox file on my server, but the following command

 npm install --global --cache ./.npmbox-cache --optional --no-registry --fetch-retries 0 --fetch-retry-factor 0 --fetch-retry-mintimeout 1 --fetch-retry-maxtimeout 2 npmbox

yields the following results

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files (x86)\nodejs\node.exe',
1 verbose cli 'C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '--global',
1 verbose cli '--no-registry',
1 verbose cli '--fetch-retries',
1 verbose cli '0',
1 verbose cli '--fetch-retry-factor',
1 verbose cli '0',
1 verbose cli '--fetch-retry-mintimeout',
1 verbose cli '1',
1 verbose cli '--fetch-retry-maxtimeout',
1 verbose cli '2',
1 verbose cli 'npmbox' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink C:\Program Files (x86)\nodejs\node.exe
5 verbose cache add [ 'npmbox', null ]
6 verbose cache add name=undefined spec="npmbox" args=["npmbox",null]
7 verbose parsed url { protocol: null,
7 verbose parsed url slashes: null,
7 verbose parsed url auth: null,
7 verbose parsed url host: null,
7 verbose parsed url port: null,
7 verbose parsed url hostname: null,
7 verbose parsed url hash: null,
7 verbose parsed url search: null,
7 verbose parsed url query: null,
7 verbose parsed url pathname: 'npmbox',
7 verbose parsed url path: 'npmbox',
7 verbose parsed url href: 'npmbox' }
8 silly lockFile f93a988d-npmbox npmbox
9 verbose lock npmbox C:\Users\Tp\AppData\Roaming\npm-cache\f93a988d-npmbox.lock
10 silly lockFile f93a988d-npmbox npmbox
11 silly lockFile f93a988d-npmbox npmbox
12 verbose addNamed [ 'npmbox', '' ]
13 verbose addNamed [ null, '' ]
14 silly lockFile 685b8df2-npmbox npmbox@
15 verbose lock npmbox@ C:\Users\Tp\AppData\Roaming\npm-cache\685b8df2-npmbox.lock
16 silly addNameRange { name: 'npmbox', range: '
', hasData: false }
17 error TypeError: Cannot call method 'replace' of null
17 error at cf (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\npm-cache-filename\index.js:11:18)
17 error at RegClient.get (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\get.js:24:20)
17 error at addNameRange (C:\Program Files (x86)\nodejs\node_modules\npm\lib\cache\add-named.js:198:12)
17 error at C:\Program Files (x86)\nodejs\node_modules\npm\lib\cache\add-named.js:47:5
17 error at C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\locker.js:30:7
17 error at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\lockfile\lockfile.js:143:23
17 error at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\lockfile\lockfile.js:143:23
17 error at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\lockfile\lockfile.js:143:23
17 error at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\lockfile\lockfile.js:143:23
17 error at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\lockfile\lockfile.js:143:23
18 error If you need help, you may report this entire log,
18 error including the npm and node versions, at:
18 error http://github.com/npm/npm/issues
19 error System Windows_NT 6.1.7601
20 error command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "--global" "--no-registry" "--fetch-retries" "0" "--fetch-retry-factor" "0" "--fetch-retry-mintimeout" "1" "--fetch-retry-maxtimeout" "2" "npmbox"
21 error cwd u:
22 error node -v v0.10.29
23 error npm -v 1.4.14
24 error type non_object_property_call
25 verbose exit [ 1, true ]

Npmbox offline install error

Hey arei, thanks for this great tool. When I extract my npmbox.npmbox archive and try to run the install command I get the following error:

npm ERR! Error: No registry url provided: GET npmbox
npm ERR! at RegClient.regRequest as request
npm ERR! at RegClient.get_ (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:116:8)
npm ERR! at RegClient. (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:43:15)
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/isaacs/npm/issues

npm ERR! System Linux 3.8.0-35-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--global" "--cache" "./.npmbox-cache" "--optional" "--no-registr" "--fetch-retries" "0" "--fetch-retry-factor" "0" "--fetch-retry-mintimeout" "1" "--fetch-retry-maxtimeout" "2" "npmbox"
npm ERR! cwd /home/rosterloh/Downloads/npmbox
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/rosterloh/Downloads/npmbox/npm-debug.log
npm ERR! not ok code 0

There is nothing else of interest in the log file.

Offline install not working - always trying to connect to npmjs.org WINDOWS 7

Same issue was raised and currently marked as closed but it has not been resolved in Windows 7 OS. #23

As per the comments by "arie"

1). Did you untar the npmbox.npmbox file into the current directory such that ./.npmbox.cache exists? - Yes
2). Does .npmbox.cache have a ton of stuff in it including directories for npmbox? - Yes
3). Does root have permission to see inside of .npmbox.cache? - Yes
4). Did you npmbox npmbox using an older version of npmbox? (The .npmbox.cache folder named changed in version 2, older .npmbox files won't work with the newer version.) - New Version

I have tried all the steps mentioned above but still it does not install. While installing it sends a get request to https://registry.npm.js/npmjs.org/npm/-/npm-2.9.0.taz and some other 4 urls. What could be the reason it does not get from the .npmbox.cache. Thanks in advance

npmunbox terminates unfinished with big archives

The tar.gz module has an issue with big files in version 1.0.5.
It just terminates the running program (after printing "Unpacking..."), leaving a uncompleted extract folder .npmbox-cache in the current directory.

Can be reproduced on a Ubuntu 14.04 32-bit (node 6.2.2):

npmbox protobufjs
npmunbox protobufjs

Please downgrade the dependency tar.gz to 1.0.2.

npm install --global --cache fail can you help me

npm install --global --cache ..npmbox.cache --optional --cache-min 99999 --sh rinkwrap false npmbox

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '--global',
1 verbose cli '--cache',
1 verbose cli '..npmbox.cache',
1 verbose cli '--optional',
1 verbose cli '--cache-min',
1 verbose cli '99999',
1 verbose cli '--shrinkwrap',
1 verbose cli 'false',
1 verbose cli 'npmbox' ]
2 info using [email protected]
3 info using [email protected]
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData npmbox
8 silly fetchNamedPackageData npmbox
9 silly mapToRegistry name npmbox
10 silly mapToRegistry using default registry
11 silly mapToRegistry registry https://registry.npmjs.org/
12 silly mapToRegistry uri https://registry.npmjs.org/npmbox
13 verbose request uri https://registry.npmjs.org/npmbox
14 verbose request no auth needed
15 info attempt registry request try #1 at 10:10:17
16 verbose request id 62114a1fcbf591dc
17 http request GET https://registry.npmjs.org/npmbox
18 info retry will retry, error on last attempt: Error: getaddrinfo ENOENT registry.npmjs.org:443
19 info attempt registry request try #2 at 10:10:27
20 http request GET https://registry.npmjs.org/npmbox
21 info retry will retry, error on last attempt: Error: getaddrinfo ENOENT registry.npmjs.org:443
22 info attempt registry request try #3 at 10:11:27
23 http request GET https://registry.npmjs.org/npmbox
24 silly fetchPackageMetaData Error: getaddrinfo ENOENT registry.npmjs.org:443
24 silly fetchPackageMetaData at Object.exports._errnoException (util.js:856:11)
24 silly fetchPackageMetaData at errnoException (dns.js:31:15)
24 silly fetchPackageMetaData at GetAddrInfoReqWrap.onlookup as oncomplete
24 silly fetchPackageMetaData error for npmbox { [Error: getaddrinfo ENOENT registry.npmjs.org:443]
24 silly fetchPackageMetaData code: 'ENOENT',
24 silly fetchPackageMetaData errno: 'ENOENT',
24 silly fetchPackageMetaData syscall: 'getaddrinfo',
24 silly fetchPackageMetaData hostname: 'registry.npmjs.org',
24 silly fetchPackageMetaData host: 'registry.npmjs.org',
24 silly fetchPackageMetaData port: 443 }
25 silly rollbackFailedOptional Starting
26 silly rollbackFailedOptional Finishing
27 silly runTopLevelLifecycles Starting
28 silly runTopLevelLifecycles Finishing
29 silly install printInstalled
30 verbose stack Error: getaddrinfo ENOENT registry.npmjs.org:443
30 verbose stack at Object.exports._errnoException (util.js:856:11)
30 verbose stack at errnoException (dns.js:31:15)
30 verbose stack at GetAddrInfoReqWrap.onlookup as oncomplete
31 verbose cwd H:\node\off
32 error Windows_NT 10.0.10586
33 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "--global" "--cache" "..npmbox.cache" "--optional" "--cache-min" "99999" "--shrinkwrap" "false" "npmbox"
34 error node v5.7.0
35 error npm v3.6.0
36 error code ENOENT
37 error errno ENOENT
38 error syscall getaddrinfo
39 error enoent getaddrinfo ENOENT registry.npmjs.org:443
40 error enoent getaddrinfo ENOENT registry.npmjs.org:443
40 error enoent This is most likely not a problem with npm itself
40 error enoent and is related to npm not being able to find a file.
41 verbose exit [ 1, true ]

npmbox dependencies with github reference in a restrictive environment

I am planning to use npmbox/npmunbox in a restrictive environment with no access to internet. There are few dependencies which are referring to Github and npmunbox fails. How can I use npmbox to package Github/bitbucket references, so that i can use it to unbox on restriction environment.

Thanks,
Sunny

install sinopia with npmunbox on the offline windows7 fail, but gulp successly

os: win7(offline)
node: v4.2.4
npm: 2.14
sinopia: 1.4.0

i try a lot but still fail, so thanks a lot for your time and help me

i have install gulp successly with npmunbox the .npmbox file. but when i try to install sinopia by the same way, it always fail, for the reason(from the log i get by -v param ), the npmunbox try to download the packages(which are contained in the 'box' generator by npmbox) from http://registry.npmjs.org, instead of local

but the logs from installing gulp, it install the packages from the local 'box' correctly.

upload the file tree and part of the log
image

image

Fix for possible issue with offline installs

I, like some people who wrote previous issues, had problems trying to install packages offline using the suggested method.

Everytime I would try to npmubox the following error would appear:

{ [Error: getaddrinfo ESRCH] code: 'ESRCH', errno: 'ESRCH', syscall: 'getaddrinfo' }

What I found that fixes this problem was to clear my npm cache before boxing and unboxing the desired package.

So on online machine:

npm cache clean
npmbox

Offline machine:

npm cache clean
npmunbox

Instead of posting this in every question that is open maybe this could be added to the README?

run npmbox on a local, unpublished package

Hi,

It seems that npmbox requires the package to be published before it can be bundled.

Do you think this could be changed? I.e. would it be possibe to make npmbox work on the current directory, similar to the way npm does?

npmbox repeatedly tries to load fsevents optional dependency from registry

Many packages have an optional dependency to fsevents, a package that only works on MacOS. When I box these packages on a Linux host, it hence doesn't include the package.

When I deploy the boxed package to my CI server which has no network access, it tries repeatedly to fetch the package from registry.npmjs.org (which would tell it not to install as wrong arch) which causes it to hang for quite a while as it can't open a connection.

npm WARN optional Skipping failed optional dependency /karma/chokidar/fsevents:
npm WARN network connect ETIMEDOUT 151.101.60.162:443
npm WARN optional Skipping failed optional dependency /watchify/chokidar/fsevents:
npm WARN network connect ETIMEDOUT 151.101.60.162:443

Is there either a way to either package in the optional dep when we box or to make it not go to registry for optional dependencies?

Error in using npmbox

While installing package i end up with following error 👍
npm Error: Error: ENOENT, open '/home/test_bb/tmp/npm-2871/1389160972084-0.9523017220199108/package/package.json'

Creating archive /usr/local/bin/npmbox.npmbox...

/usr/local/lib/node_modules/npmbox/node_modules/npm/node_modules/lockfile/lockfile.js:46
throw er
^
Error: ENOENT, lstat '/home/test_bb/.npmbox-cache/21e9adfc-bonescript.lock'

My config -
node : v0.11.11-pre
npm : 1.3.22

Issue with offline install

Trying to do the offline install and ran into two issues:

  • When doing step number 4 and running tar -xvfo npmbox.npmbox I get the following Terminal error: tar: Error opening archive: Failed to open 'o'

If I run the command without as tar -xvf npmbox.npmbox (without the 'o') it runs fine and creates the .npmbox-cache folder. Not sure if that's critical or not.

  • After doing the above, I run the code in step 5 npm install --global --cache ./.npmbox-cache --optional --cache-min 999999 --fetch-retries 0 --fetch-retry-factor 0 --fetch-retry-mintimeout 1 --fetch-retry-maxtimeout 2 npmbox (copied and pasted into Ternimal). When I do that I the first thing that comes up are npm GET requests to the npm registry url followed by network errors that the tunneling socket could not be established and I'm most likely behind a proxy.

Seems like the offline install of npmbox is not working properly or I'm doing something wrong.

In case it matters: npm v1.3.21, node v0.10.24

Make npmbox work simultaneously

If you run npmbox at the same time as another npmbox, the two will try to use the same directory (.npmbox-cache) which could cause conflicts. However, npmunbox requires that npmbox use this naming convention.

npmbox needs to use a temporary name structure when downloading the packages and then convert the name as it is being written into the .npmbox file so as to not create overlaps.

Error installing the new version

When trying to install the new version, I get the following errors:

C:\Users\YONK\Documents\libs\npmbox\npmbox>npm install --verbose --global --cache ./.npmbox.cache --optional --cache-min 99999 npmbox
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
npm verb cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   'install',
npm verb cli   '--verbose',
npm verb cli   '--global',
npm verb cli   '--cache',
npm verb cli   './.npmbox.cache',
npm verb cli   '--optional',
npm verb cli   '--cache-min',
npm verb cli   '99999',
npm verb cli   'npmbox' ]
npm info using [email protected]
npm info using [email protected]
npm verb node symlink C:\Program Files\nodejs\\node.exe
npm verb cache add spec npmbox
npm verb addTmpTarball C:\Users\YONK\Documents\libs\npmbox\npmbox\npmbox not in flight; adding
npm verb addTmpTarball validating metadata from C:\Users\YONK\Documents\libs\npmbox\npmbox\npmbox
npm verb tar unpack C:\Users\YONK\Documents\libs\npmbox\npmbox\npmbox
npm verb tar unpacking to C:\Users\YONK\AppData\Local\Temp\npm-6456-67c70f8d\unpack-3b1a8d48127e
npm verb gentlyRm vacuuming C:\Users\YONK\AppData\Local\Temp\npm-6456-67c70f8d\unpack-3b1a8d48127e
npm ERR! addLocal Could not install C:\Users\YONK\Documents\libs\npmbox\npmbox\npmbox
npm verb stack Error: ENOENT, open 'C:\Users\YONK\AppData\Local\Temp\npm-6456-67c70f8d\unpack-3b1a8d48127e\package.json'
npm verb stack     at Error (native)
npm verb cwd C:\Users\YONK\Documents\libs\npmbox\npmbox
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--verbose" "--global" "--cache" "./.npmbox.cache" "--optional" "--cache-min" "99999" "npmbox"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! path C:\Users\YONK\AppData\Local\Temp\npm-6456-67c70f8d\unpack-3b1a8d48127e\package.json
npm ERR! code ENOENT
npm ERR! errno -4058

npm ERR! enoent ENOENT, open 'C:\Users\YONK\AppData\Local\Temp\npm-6456-67c70f8d\unpack-3b1a8d48127e\package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm verb exit [ -4058, true ]

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\YONK\Documents\libs\npmbox\npmbox\npm-debug.log

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.