arei / npmbox

Utility for creating (boxing) and using (unboxing) an archive of a complete (including all dependencies) npm install.
MIT License
245 stars 34 forks source link

Installing npmbox still reaches out for five packages on offline system #27

Closed eldavojohn closed 9 years ago

eldavojohn commented 9 years ago

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!

eldavojohn commented 9 years ago

Just reverted back to npmbox v1.0.0 which works flawlessly. I use the same exact command (changing .npmbox-cache to .npmbox.cache) on v2.3.1 and it again tries to connect to the registry. Not sure why one works and the newer one does not. Any additional information or help would be greatly appreciated!

YonatanKra commented 9 years ago

It seems related, so I post it here. I get a lot of "no connection" issues. Here's a link to the issue with the log I also have trouble installing the new version. I don't know if this is related...

eldavojohn commented 9 years ago

yccteam, thanks! ... I tinkered with this a bunch last night and tried to figure out what was going on but continually came to the conclusion that on Windows (32 bit or 64 bit I tried both) I cannot get npmbox to work as the markdown file indicates. It continually reaches out for files on the offline system.

Again, the same exact procedure with npmbox v1.0.0 works without any problems. I am only experiencing issues when I try to upgrade to npmbox v2.3.1. I have started with fresh installs on my target offline system and it behaves the same way.

Zelarith commented 9 years ago

I have the same problem. Both machines (online and offline) have these versions of the softs : node v 0.12.2 npm v 2.7.4 npmbox 2.3.1

Online machine is on Windows 7 Offline on Windows Server 2008

And I can't even use an older version of npmbox : no matter wich version of npmbox I use on my online machine, npmbox npmbox will pack the latest version of npmbox, namely npmbox 2.3.1, for my offline server to unpack (wich fails).

Any workaround for this?

arei commented 9 years ago

npmbox npmbox@x.x.x might work to get a different version.

Zelarith commented 9 years ago

Why didn't I even try to do just that?

It worked, thanks :)

Also had to change the offline machine's command to npm install --global --cache ./.npmbox-cache --optional --cache-min 99999 npmbox@1.0.0

Sub-Star commented 9 years ago

I encountered this issue as well, while trying to install npmbox on my offline machine.

By the looks of it, it appears that npmbox doesn't respect the dependencies defined in npm-shrinkwrap.json, and just downloads the dependencies based on what's defined in package.json. This causes npmbox to download the newest version of some dependencies instead of the exact version that is referenced in npm-shrinkwrap.json, and this again causes npm install on the offline computer to try to get the specific versions for all dependencies (because npm install by default respects npm-shrinkwrap.json). This of course fails with an error complaining about npm not being able to download package@version from registry.npmjs.org.

I can imagine that this error only surfaced some time after npmbox@2.3.1 was released, because some of its dependencies have released never versions since npmbox@2.3.1 was released.

Sub-Star commented 9 years ago

I've discovered a workaround that worked for me (works on my machine): When installing npmbox on the offline computer, add --shrinkwrap false to the npm install command line, like this:

npm install --global --cache ./.npmbox-cache --optional --cache-min 99999 --shrinkwrap false npmbox

When I ran this, npm only complained about npm@2.8.4, so I npmbox'ed npm@2.8.4, extracted the content (.npmbox.cache) to the same directory that I used for npmbox (on the offline pc), not overwriting anything, and then ran the command again. npmbox@2.3.1 is now installed on my offline pc! =)

arei commented 9 years ago

Actually @Sub-Star is both right and wrong. It is a shrinkwrap problem, but its because shrinkwrap hard codes the location to to get the dependencies from. I believe adding --shrinkwrap false to the npm command will resolve the problem. Also, please make sure that your --cache setting has the correct path delimiters if using windows. So it should look like this:

npm install --global --cache .\.npmbox-cache --optional --cache-min 99999 --shrinkwrap false npmbox

I am updating the documentation.

Sub-Star commented 9 years ago

@arei Ok, thanks for looking into it. I'm quite new to the whole node.js/npm/packages stuff.

I see we both came up with the same workaround. ;)

The only thing I don't understand then is why I had to get npm@2.8.4 in addition to npmbox. I looked in my .npmbox.cache folder, and I had npm@2.9.0 there. Can you explain that?

arei commented 9 years ago

I'm in the middle of upgrading the dependencies and you might have gotten a version of npmbox that was published while in transition. 2.6.0 is now up.

shuninghuang commented 9 years ago

Hi @arei, I run npm install --verbose --global --cache ./.npmbox-cache --optional --cache-min 99999 --shrinkwrap false npmbox with npm@2.8.3 and npmbox@2.6.1, but I will get npm http request GET https://registry.npmjs.org/rimraf npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT which breaks the installation.

arei commented 9 years ago

Please open a new issue anD include a copy of the log output if possible.