rxaviers / cldr-data-npm

Npm module for Unicode CLDR JSON data
MIT License
42 stars 28 forks source link

Follow up https://github.com/jquery/globalize/issues/507 #19

Closed rxaviers closed 8 years ago

rxaviers commented 9 years ago

@leniel has filed an issue on Globalize https://github.com/jquery/globalize/issues/507, where he was unable to execute npm install cldr-data. The goal of this issue is to follow up with debugging.

npm-debug.log content: https://gist.github.com/leniel/22f2efda33175020047a

rxaviers commented 9 years ago

@leniel, your gist says something wrong happened executing the install script 4839 info cldr-data@27.0.6 Failed to exec install script.

Can you try to chdir to C:\Users\Leniel\node_modules\cldr-data and execute node install.js and paste the output in a new gist please?

leniel commented 9 years ago

Interesting C:\Users\Leniel\node_modules is empty right now.

rxaviers commented 9 years ago

If you open a terminal (cmd in windows) and type node, what do you get please?

leniel commented 9 years ago

I get this:

Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\Leniel>node
>
rxaviers commented 9 years ago

Alright, so you have node installed.

Now, can you try:

npm install cldr-data-downloader
cd node_modules/cldr-data-downloader/
node node_modules/.bin/cldr-data-downloader -i https://github.com/unicode-cldr/cldr-core/archive/27.0.3.zip -o core
leniel commented 9 years ago

It installed correctly but the last command failed:

C:\Users\Leniel\node_modules\cldr-data-downloader>node node_modules/.bin/cldr-data-downloader -i https://github.com/unicode-cld
/cldr-core/archive/27.0.3.zip -o corecls

module.js:340
    throw err;
          ^
Error: Cannot find module 'C:\Users\Leniel\node_modules\cldr-data-downloader\node_modules\.bin\cldr-data-downloader'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3
rxaviers commented 9 years ago

Interesting, you should have the file below:

node_modules/.bin/
└── cldr-data-downloader -> ../cldr-data-downloader/bin/download.sh

But, let's try one more command:

node node_modules/cldr-data-downloader/bin/download.js -i https://github.com/unicode-cldr/cldr-core/archive/27.0.3.zip -o core
leniel commented 9 years ago

Yep... I do have that download.sh file along with download.js.

This is the error I got:

C:\Users\Leniel\node_modules\cldr-data-downloader>node node_modules/cldr-data-downloader/bin/download.js -i https://github.com/
nicode-cldr/cldr-core/archive/27.0.3.zip -o core

module.js:340
    throw err;
          ^
Error: Cannot find module 'C:\Users\Leniel\node_modules\cldr-data-downloader\node_modules\cldr-data-downloader\bin\download.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3

Looks like it's messing up the directory path... you see, it repeats node_modules twice in the folder path in the error message.

rxaviers commented 9 years ago

Given you're inside C:\Users\Leniel\node_modules\cldr-data-downloader, your command should be then:

node bin/download.js -i https://github.com/unicode-cldr/cldr-core/archive/27.0.3.zip -o core
leniel commented 9 years ago

The command worked now but something went wrong:

C:\Users\Leniel\node_modules\cldr-data-downloader>node bin/download.js -i https://github.com/unicode-cldr/cldr-core/archive/27.0
.3.zip -o core
GET `https://github.com/unicode-cldr/cldr-core/archive/27.0.3.zip`
  [========================================] 110245/110245 100% 0.0s
Received 107K total.
Unpacking it into `./core`
Whops Error generating available locales. ENOENT, no such file or directory 'C:\Users\Leniel\node_modules\cldr-data-downloader\c
ore\main'
rxaviers commented 9 years ago

This last error is expected, because we only downloaded core in this special test. So, your node is working fine to download the ZIP and extract it. I'm wondering why your npm install cldr-data fails. Couldn't figure yet so far.

Can you try installing a previous cldr-data version?

cd C:\Users\Leniel
npm install cldr-data@26.x
leniel commented 9 years ago

Interesting... the previous cldr-data version worked:

Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\Leniel>npm install cldr-data@26.x
npm http GET https://registry.npmjs.org/cldr-data
npm http 304 https://registry.npmjs.org/cldr-data
npm http GET https://registry.npmjs.org/cldr-data/-/cldr-data-26.0.13.tgz
npm http 200 https://registry.npmjs.org/cldr-data/-/cldr-data-26.0.13.tgz
npm http GET https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/inflight
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/once
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/path-is-absolute
npm http 304 https://registry.npmjs.org/inflight
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/once
npm http 304 https://registry.npmjs.org/minimatch
npm http 200 https://registry.npmjs.org/path-is-absolute
npm http GET https://registry.npmjs.org/wrappy
npm http GET https://registry.npmjs.org/brace-expansion
npm http 304 https://registry.npmjs.org/wrappy
npm http 304 https://registry.npmjs.org/brace-expansion
npm http GET https://registry.npmjs.org/balanced-match
npm http GET https://registry.npmjs.org/concat-map/0.0.1
npm http 304 https://registry.npmjs.org/concat-map/0.0.1
npm http 304 https://registry.npmjs.org/balanced-match

> cldr-data@26.0.13 install C:\Users\Leniel\node_modules\cldr-data
> node install.js

GET `http://www.unicode.org/Public/cldr/26.0.1/json.zip`
  [========================================] 3490318/3507117 100% 0.1sReceived 3408K total.
  [========================================] 3507117/3507117 100% 0.0s
Received 3424K total.
Unpacking it into `./`
cldr-data@26.0.13 node_modules\cldr-data
└── glob@5.0.14 (path-is-absolute@1.0.0, inherits@2.0.1, once@1.3.2, inflight@1.0.4, minimatch@2.0.10)

C:\Users\Leniel>
rxaviers commented 9 years ago

Hm interesting... The only difference between previous cldr-data 26.x and up-to-date 27.x is the number of urls it needs to download in order to give you a complete set of the data.

To continue debugging this issue, I suggest you go to a temporary directory, then:

git clone git@github.com:rxaviers/cldr-data-npm.git
cd cldr-data-npm/
npm install cldr-data-downloader
node node_modules/cldr-data-downloader/bin/download.js -i urls.json -o output
martingg88 commented 8 years ago

will have this issue for version >= 27

Error: 101057795:error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac:openssl\ssl\s3_pk t.c:532:

rxaviers commented 8 years ago

Closing due to lack of activity. Also, I cannot reproduce this error, because I don't use Windows. Sorry. Although, I am open to accept PRs fixing it. Thanks all.