Giter Site home page Giter Site logo

cldr-data-downloader's People

Contributors

achrinza avatar briangleeson avatar chrismichaelmurphy avatar dependabot[bot] avatar diokuz avatar dominicbartl avatar elliot-nelson avatar jkoutsoumpas avatar kevinsandow avatar naholyr avatar omerlh avatar paularmstrong avatar rxaviers avatar slexaxton avatar tinganho avatar vince-f avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

cldr-data-downloader's Issues

Save state and avoid to re-download unecessarily

Create a state.json in the destPath with parameters used in the download, i.e. srcPath for now.

Check that file before begin downloading and exit if nothing needs to be done.

Add -f option to bypass this check.

deepEqual throws an error on Node 8, NPM 5

Installing cldr-data using Node 8 & NPM 5 throws this error:

> [email protected] install <<project dir>>/node_modules/cldr-data
> node install.js

Whops {} deepEqual { url: 
   [ 'https://github.com/unicode-cldr/cldr-core/archive/28.0.2.zip',
     'https://github.com/unicode-cldr/cldr-dates-mo

Where <<project dir>> is the working directory of npm install.

I can't tell why the error is truncated, or if this is just the intended error. Installing with Node v7.5.0 and NPM 4.1.2 works.

Error requesting archive

Running npm i cldr-data fails:

I tried pinning it to anything between 29.0.0 and 31.0.2 and all versions fail with one or the other download resulting in an 500 error.

Output

> [email protected] install ...\node_modules\cldr-data
> node install.js

GET `https://github.com/unicode-cldr/cldr-core/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-dates-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-buddhist-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-chinese-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-coptic-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-dangi-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-ethiopic-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-hebrew-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-indian-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-islamic-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-japanese-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-persian-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-roc-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-localenames-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-misc-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-numbers-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-segments-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-units-modern/archive/31.0.1.zip`
  [----------------------------------------] 9236020/Infinity 0% 0.0s...\node_modules\cldr-data-downloader\lib\download.js:134
      throw error;
      ^

Error: Error requesting archive.
Status: 500
Request options: {
  "url": "https://github.com/unicode-cldr/cldr-localenames-modern/archive/31.0.1.zip",
  "headers": {
    "User-Agent": "curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5"
  },
  "followRedirect": true,
  "encoding": null
}
Response headers: {
  "content-length": "27",
  "access-control-allow-origin": "https://render.githubusercontent.com",
  "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'",
  "strict-transport-security": "max-age=31536000",
  "vary": "Authorization,Accept-Encoding",
  "x-content-type-options": "nosniff",
  "x-frame-options": "deny",
  "x-xss-protection": "1; mode=block",
  "date": "Wed, 23 Aug 2017 13:06:34 GMT",
  "x-github-request-id": "F881:2B768:DBDE:13592:599D7DD3",
  "connection": "close"
}
Make sure your network and proxy settings are correct.

If you continue to have issues, please report this full log at https://github.com/rxaviers/cldr-data-downloader
    at Request._callback (...\node_modules\cldr-data-downloader\lib\download.js:126:15)
    at Request.self.callback (...\node_modules\request\request.js:187:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (...\node_modules\request\request.js:1044:10)
    at emitOne (events.js:120:20)
    at Request.emit (events.js:210:7)
    at IncomingMessage.<anonymous> (...\node_modules\request\request.js:965:12)
    at emitNone (events.js:110:20)
    at IncomingMessage.emit (events.js:207:7)

Download error

When installing cldr-data I get the following error:

Whops Error making request.
Error: error request aborted
at createError (C:\Users...\node_modules\axios\lib\core\createError.js:16:15)
at IncomingMessage.handlerStreamAborted (C:\Users...\node_modules\axios\lib\adapters\http.js:301:18)
at IncomingMessage.emit (events.js:315:20)
at TLSSocket.socketCloseListener (_http_client.js:426:11)
at TLSSocket.emit (events.js:327:22)
at net.js:673:12
at TCP.done (_tls_wrap.js:563:7)

Thanks alot

Specify cldr version without pass all cldr's download url

The first argument is the number of defined version, what do you think @rxaviers ?

Example:

     cldrDownloader(25, "./cldr", function(error) { ...

or using a object

      var options = {
               version: 25,
               destPath: "./cldr"
      };

      cldrDownloader(options, function(error) {

I've done these changes in the code. if you find a good one, I use it as PR

install error , use browser can download zip url file

6014 info run [email protected] install node_modules/cldr-data node install.js
6015 info run [email protected] install { code: 1, signal: null }
6016 timing reify:rollback:createSparse Completed in 30311ms
6017 timing reify:rollback:retireShallow Completed in 0ms
6018 timing command:install Completed in 715035ms
6019 verbose stack Error: command failed
6019 verbose stack at ChildProcess. (D:\repo\nodejs\node_global\node_modules\npm\node_modules@npmcli\promise-spawn\lib\index.js:63:27)
6019 verbose stack at ChildProcess.emit (node:events:526:28)
6019 verbose stack at maybeClose (node:internal/child_process:1092:16)
6019 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
6020 verbose pkgid [email protected]
6021 verbose cwd D:\coinv\develop\mts2\mts2-install\install-ui
6022 verbose Windows_NT 10.0.22621
6023 verbose node v16.14.2
6024 verbose npm v8.7.0
6025 error code 1
6026 error path D:\coinv\develop\mts2\mts2-install\install-ui\node_modules\cldr-data
6027 error command failed
6028 error command C:\WINDOWS\system32\cmd.exe /d /s /c node install.js
6029 error GET https://github.com/unicode-cldr/cldr-core/archive/36.0.0.zip
6029 error GET https://github.com/unicode-cldr/cldr-dates-modern/archive/36.0.0.zip
6029 error GET https://github.com/unicode-cldr/cldr-cal-buddhist-modern/archive/36.0.0.zip
6029 error GET https://github.com/unicode-cldr/cldr-cal-chinese-modern/archive/36.0.0.zip
6029 error GET https://github.com/unicode-cldr/cldr-cal-coptic-modern/archive/36.0.0.zip
6029 error GET https://github.com/unicode-cldr/cldr-cal-dangi-modern/archive/36.0.0.zip
6029 error GET https://github.com/unicode-cldr/cldr-cal-ethiopic-modern/archive/36.0.0.zip
6029 error GET https://github.com/unicode-cldr/cldr-cal-hebrew-modern/archive/36.0.0.zip
6029 error GET https://github.com/unicode-cldr/cldr-cal-indian-modern/archive/36.0.0.zip
6029 error GET https://github.com/unicode-cldr/cldr-cal-islamic-modern/archive/36.0.0.zip
6029 error GET https://github.com/unicode-cldr/cldr-cal-japanese-modern/archive/36.0.0.zip
6029 error GET https://github.com/unicode-cldr/cldr-cal-persian-modern/archive/36.0.0.zip
6029 error GET https://github.com/unicode-cldr/cldr-cal-roc-modern/archive/36.0.0.zip
6029 error GET https://github.com/unicode-cldr/cldr-localenames-modern/archive/36.0.0.zip
6029 error GET https://github.com/unicode-cldr/cldr-misc-modern/archive/36.0.0.zip
6029 error GET https://github.com/unicode-cldr/cldr-numbers-modern/archive/36.0.0.zip
6029 error GET https://github.com/unicode-cldr/cldr-segments-modern/archive/36.0.0.zip
6029 error GET https://github.com/unicode-cldr/cldr-units-modern/archive/36.0.0.zip
6030 error Whops Error making request.
6030 error Error: socket hang up
6030 error at connResetException (node:internal/errors:691:14)
6030 error at TLSSocket.socketOnEnd (node:_http_client:466:23)
6030 error at TLSSocket.emit (node:events:538:35)
6030 error at endReadableNT (node:internal/streams/readable:1345:12)
6030 error at processTicksAndRejections (node:internal/process/task_queues:83:21)
6030 error
6030 error Please report this full log at https://github.com/rxaviers/cldr-data-downloader
6031 verbose exit 1
6032 timing npm Completed in 715221ms
6033 verbose unfinished npm timer reify 1665225890966
6034 verbose unfinished npm timer reify:build 1665225973060
6035 verbose unfinished npm timer build 1665225973063
6036 verbose unfinished npm timer build:deps 1665225973064
6037 verbose unfinished npm timer build:run:install 1665225973282
6038 verbose unfinished npm timer build:run:install:node_modules/cldr-data 1665225973282
6039 verbose code 1
6040 error A complete log of this run can be found in:
6040 error D:\repo\nodejs\node_cache_logs\2022-10-08T10_44_50_792Z-debug-0.log

New official CLDR JSON format (CLDR ≥ 27) breaks cldr-data-downloader

Since version 27, CLDR JSON data is officially hosted at https://github.com/unicode-org/cldr-json/releases and the format changed. (JSON data is not hosted anymore at http://www.unicode.org/Public/cldr/ for CLDR ≥ 27.)

Instead of multiple zip files (e.g. cldr-core.zip, cldr-dates-full.zip, etc.), each containing:

├── apache-license.txt
├── icu-license.html
├── main
├── README
├── readme.html
├── supplemental
└── unicode-license.txt

... the new format is a full zip (e.g. cldr-39.0.0-json-full.zip) with everything in it:

├── cldr-annotations-full
├── cldr-cal-buddhist-full
...
├── cldr-cal-roc-full
├── cldr-core
│   ├── availableLocales.json
│   ├── bower.json
│   ├── defaultContent.json
│   ├── LICENSE
│   ├── package.json
│   ├── README.md
│   ├── scriptMetadata.json
│   └── supplemental
├── cldr-dates-full
├── cldr-localenames-full
...
└── cldr-units-full

Would a pull request to move to the new format be accepted? If yes, do you have any hints on how to proceed?

Thanks in advance.

Support filesystem location of the cldr files

In order to reduce dependencies on external services in our builds, I have a need to just pass a file system path to the relevant zip files.

e.g.

{
  "core": [
    "file://path/to/cldrstuff/cldr-core/archive/31.0.1.zip",
    "file://path/to/cldrstuff/cldr-dates-modern/archive/31.0.1.zip",
    "file://path/to/cldrstuff/cldr-cal-buddhist-modern/archive/31.0.1.zip",
    "file://path/to/cldrstuff/cldr-cal-chinese-modern/archive/31.0.1.zip",
    "file://path/to/cldrstuff/cldr-cal-coptic-modern/archive/31.0.1.zip"
  ]
}

AND/OR

{
  "core": [
    "../../cldr-core/archive/31.0.1.zip",
    "../../cldr-dates-modern/archive/31.0.1.zip",
    "../../cldr-cal-buddhist-modern/archive/31.0.1.zip",
    "../../cldr-cal-chinese-modern/archive/31.0.1.zip",
    "../../cldr-cal-coptic-modern/archive/31.0.1.zip"
  ]
}

Since the paths get passed directly into request they fail, because it doesn't support file paths. I can get files in S3, but can only retrieve them over the s3:// protocol, which seems far-fetched to support here. I can set up a little server that serves them from the file system to work around it, but that doesn't feel great :D.

I'm happy to submit a PR for this if you're interested in supporting it.

npm install error

When I "npm_install" for the first time cldr-data-downloader crashes. After this first time everything works fine.

Same beahviour when I deploy to azure. When new version is updated and deployment script try to "npm_install" for the first time it crashes. Subsequent deployments work fine.

This time the error was "Cannot find module 'tough-cookie' but the module name changes on every attempt.

Any idea would be helpfull.

Thank you anyway

..............

module.js:340
throw err;
^
Error: Cannot find module 'tough-cookie'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (C:\Users\myusername\Documents\GitHub\myprojectname\node_modules\cldr-data-downloader\node_modules\request\lib\cookies.js:3:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
npm WARN engine [email protected]: wanted: {"node":">=0.10.32"} (current: {"node":"v0.10.29","npm":"1.4.14"})
npm ERR! [email protected] install: node install.js
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the cldr-data package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls cldr-data
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! cwd C:\Users\jv.io\Documents\GitHub\userAdmin
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE

Specify cache location for zip files

I have a situation where we have servers that are typically locked down (unable to access the internet), but we still need fresh installs (sometimes in new folders) of npm install cldr-data to work.

I know that we could manually download all of the ZIP files (listed in the related cldr-data-npm repo : urls.json), and use a custom urls.json, which points at all local files. The trouble with that is we'd need to do all those steps again every time we want to update to a new cldr-data, which we'd need to coordinate with developers.

What I'd much prefer is an option that could be passed to cldr-data-downloader for a cache folder; and the new behavior would be:

[all urls to download].forEach(url => {
    if (cacheFolder) tryToRead(`${cacheFolder}/${md5hash(url)}.zip`);
    Otherwise, download(url);
});

This way, as long as any time a new version of cldr-data comes out we once run npm install successfully, we know every future install on that machine will work as well (because it won't require internet access to GitHub).

Would you be open to this kind of functionality if I put it in a PR? Or maybe do you have a suggestion on how to accomplish a "no-download" install option, without having to manually update everything for every new version?

Fix install warnings due to deprecation

Installing this package gives the following warnings:

npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN deprecated [email protected]: Use uuid module instead

I believe the npmconf dependency can be removed without issues. The node-uuid one can be fixed by updating the request dependency (current version 2.74, latest is 2.81)

node-uuid warning in request, replace?

The request version in use by the current version of this library / cldr-data uses a version of request with a uuid warning.

warning cldr-data > cldr-data-downloader > request > [email protected]: Use uuid module instead

The request library actually isn't a great library to use. Judging by the fact that this library is pinned to ~ instead of ^ someone has probably already noticed that request has a really poor stance towards breaking changes (they are happy to include breaking changes from deps within minor release changes). Despite that the library is released frequently, meaning you need to update it regularly. The library is also bloated and a bit of a risk, it includes huge piles of dependences that are never used (hawk, aws, oauth, etc...) and each of those can have security bugs that need patching on top of bloating the package with huge deps that are never used.

A simple way of solving the npm warning and general issues with request would be to replace it. One alternative with a somewhat request like API is needle. You could also go with node-fetch.

Release changes to npm

It would be nice if a new version were released to NPM.

Six months ago npmconf was removed from this package, but this change has not been released to npm.

The version in npm still uses npmconf, which is a bit annoying because this package was depending on an obsolete version of the package that has an invalid license property. Which can trip up simple licence checking code.

Security vulnerability with package adm-zip

The distributed npm package adm-zip have vulnerability and need to be updated.
(Container) scanning tools like Twistlock raise security issue, e.g.

Type:              vulnerability
CVE:               2021-0034
Package Name:      adm-zip
Package Ver.:      0.4.11
Status:            fixed in 0.5.3
Description:       adm-zip package versions before 0.5.3 are vulnerable to Directory Traversal. It could extract files outside the target folder.

Package need to be updated to 0.5.3 or above. @rxaviers

Downloading during install stage of `cldr-data` fails

Having difficulty successfully installing the cldr-data package and its raising the following error from cldr-data-downloader:

Exit code: 1
Command: sh
Arguments: -c node install.js
/some/path/on/my/filesystem/node_modules/cldr-data
Output:
GET `https://github.com/unicode-cldr/cldr-core/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-dates-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-buddhist-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-chinese-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-coptic-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-dangi-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-ethiopic-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-hebrew-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-indian-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-islamic-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-japanese-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-persian-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-cal-roc-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-localenames-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-misc-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-numbers-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-segments-modern/archive/31.0.1.zip`
GET `https://github.com/unicode-cldr/cldr-units-modern/archive/31.0.1.zip`
/some/path/on/my/filesystem/node_modules/cldr-data-downloader/lib/download.js:119
      throw error;
      ^

Error: connect ETIMEDOUT 192.30.255.112:443
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)".

Platform information:
macOS 10.12.6
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

I have run into this issue with the downloader in the past, but it has been chugging along for the past ~6mos or so without much of a hiccup until today. My success rate today is ~5%.

When I try to download what seems to be the offending cldr zip (https://github.com/unicode-cldr/cldr-units-modern/archive/31.0.1.zip), the browser completes the download just fine.

I've done a bit of digging around in both cldr-data-downloader and request to try and get a better picture of what's going on. Investigation shows that request appears to be getting a 200, closing the connection, and emitting the complete event, but the downloader still does not not finish successfully:

(end of output NODE_DEBUG=request npm run install from inside node_modules/cldr-data)

REQUEST response end https://codeload.github.com/unicode-cldr/cldr-numbers-modern/zip/31.0.1 200 { 'content-length': '3629675',
  'access-control-allow-origin': 'https://render.githubusercontent.com',
  'content-security-policy': 'default-src \'none\'; style-src \'unsafe-inline\'; sandbox',
  'strict-transport-security': 'max-age=31536000',
  vary: 'Authorization,Accept-Encoding',
  'x-content-type-options': 'nosniff',
  'x-frame-options': 'deny',
  'x-xss-protection': '1; mode=block',
  etag: '"39f1f5bac2fa7a22fd33636ad4d6f1b179c61cd5"',
  'content-type': 'application/zip',
  'content-disposition': 'attachment; filename=cldr-numbers-modern-31.0.1.zip',
  'x-geo-block-list': '',
  date: 'Wed, 02 May 2018 23:16:18 GMT',
  'x-github-request-id': 'F304:5639:18A56:27D35:5AEA46C2',
  connection: 'close' }
REQUEST end event https://codeload.github.com/unicode-cldr/cldr-numbers-modern/zip/31.0.1
REQUEST has body https://codeload.github.com/unicode-cldr/cldr-numbers-modern/zip/31.0.1 3629675
REQUEST emitting complete https://codeload.github.com/unicode-cldr/cldr-numbers-modern/zip/31.0.1
  [----------------------------------------] 29012347/Infinity 0% 0.0s^C

I also get the above result when attempting to install or upgrade a dependency with yarn, bootstrapping with lerna (using yarn + workspaces under the hood), or installing with npm.

One thing that does seem to stick out to me is that the final bytes counted by request-progress may don't seem to be accurate or indicative of a successful download or not.

Does this jog anyone's memory?

Security vulnerability due to request version

λ nsp check
(+) 1 vulnerability found

Prototype pollution attack
Name hoek
CVSS 4 (Medium)
Installed 2.16.3
Vulnerable <= 4.2.0
Patched > 4.2.0 < 5.0.0
Path [email protected] > [email protected] >
[email protected] > [email protected] > [email protected] >
[email protected]
More Info https://nodesecurity.io/advisories/566

I believe this can be fixed by upgrading to use request 2.83, but I don't know if that would have any impact on functionality

See here: request/request#2874

npm install cldr-data fails at node install.js

The issue began with this post - Initial Issue

Below is the original error received when attempting npm install globalize cldr-data:

D:\Demo\Globalization\packages\node_modules\cldr-data-downloader\bin>node < my-downloader.js
GET http://www.unicode.org/Public/cldr/26/json.zip
D:\Demo\Globalization\packages\node_modules\cldr-data-downloader\lib\download.js:51
throw error;
^

Error: connect ECONNREFUSED 216.97.88.9:80
at Object.exports._errnoException (util.js:907:11)
at exports._exceptionWithHostPort (util.js:930:20)
at TCPConnectWrap.afterConnect as oncomplete

D:\Demo\Globalization\packages\node_modules\cldr-data-downloader\bin>node < my-downloader.js
GET https://github.com/unicode-cldr/cldr-core/archive/29.0.0.zip
D:\Demo\Globalization\packages\node_modules\cldr-data-downloader\lib\download.js:51
throw error;
^

Error: connect ECONNREFUSED 192.30.253.113:443
at Object.exports._errnoException (util.js:907:11)
at exports._exceptionWithHostPort (util.js:930:20)
at TCPConnectWrap.afterConnect as oncomplete

Additional t-shooting has resulted in identifying that the cldr-data install is the issue.

I attempted the following with cldr-data-downloader.

I tried the file that's listed in the usage example as well as one of the CDLR 29 links to no avail.

D:\Demo\Globalization\packages\node_modules\cldr-data-downloader\bin>node < my-downloader.js
GET http://www.unicode.org/Public/cldr/26/json.zip
D:\Demo\Globalization\packages\node_modules\cldr-data-downloader\lib\download.js:51
throw error;
^

Error: connect ECONNREFUSED 216.97.88.9:80
at Object.exports._errnoException (util.js:907:11)
at exports._exceptionWithHostPort (util.js:930:20)
at TCPConnectWrap.afterConnect as oncomplete

D:\Demo\Globalization\packages\node_modules\cldr-data-downloader\bin>node < my-downloader.js
GET https://github.com/unicode-cldr/cldr-core/archive/29.0.0.zip
D:\Demo\Globalization\packages\node_modules\cldr-data-downloader\lib\download.js:51
throw error;
^

Error: connect ECONNREFUSED 192.30.253.113:443
at Object.exports._errnoException (util.js:907:11)
at exports._exceptionWithHostPort (util.js:930:20)
at TCPConnectWrap.afterConnect as oncomplete

Proxy gets ignored

Hi,
I've set the proxy on all possible levels including

  • git
  • npm

environment variables

  • http_proxy
  • https_proxy
  • all_proxy

The settings are 100% correct, checking out git and npm update works without any problems...
Still I get this error, and our IT tells me the requests are made directly not through the proxy server, so I guess theres a bug...

npm ERR! path C:\Users\las-zin-mic\source\repos\las-portal\Source\node_modules\cldr-data
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node install.js
npm ERR! GET https://github.com/unicode-cldr/cldr-core/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-dates-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-buddhist-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-chinese-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-coptic-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-dangi-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-ethiopic-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-hebrew-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-indian-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-islamic-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-japanese-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-persian-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-roc-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-localenames-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-misc-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-numbers-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-segments-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-units-modern/archive/36.0.0.zip
npm ERR! Whops Error making request.
npm ERR! Error: Request failed with status code 500
npm ERR! at createError (C:\Users\las-zin-mic\source\repos\las-portal\Source\node_modules\axios\lib\core\createError.js:16:15)
npm ERR! at settle (C:\Users\las-zin-mic\source\repos\las-portal\Source\node_modules\axios\lib\core\settle.js:17:12)
npm ERR! at IncomingMessage.handleStreamEnd (C:\Users\las-zin-mic\source\repos\las-portal\Source\node_modules\axios\lib\adapters\http.js:322:11)
npm ERR! at IncomingMessage.emit (node:events:525:35)
npm ERR! at endReadableNT (node:internal/streams/readable:1359:12)
npm ERR! at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm ERR!
npm ERR! Please report this full log at https://github.com/rxaviers/cldr-data-downloader

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\las-zin-mic\AppData\Local\npm-cache_logs\2023-04-27T14_56_05_443Z-debug-0.log

Hope you can help,
best regards
Michael

Error while node install.js

Getting the below error while node install.js.

Error: Error requesting archive.

Status: 500

Request options: {

  "url": "https://github.com/unicode-cldr/cldr-cal-hebrew-modern/archive/32.0.0.zip",

  "headers": {

    "User-Agent": "curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5"

  },

  "followRedirect": true,

  "encoding": null

Ability to inject options into download

Hi,

I'm using cldr-data to get the core Unicode CLDR data. Unfortunately, having had it working fine, I'm now behind a corporate proxy that uses a different CA.

It seems like request takes options which can include a CA certificate and (worst case) just disabling TLS checks: https://github.com/request/request/blob/master/request.js#L254

However, the downloader doesn't allow you to pass in any options.

return download({

Would you accept a PR that added:

options.downloadOptions

which got spread into that object.

Then in cldr-data

"cldr-data-download-options" which was passed into the downloader as options.downloadOptions?

NB: For this specific issue I'm hopefuly I can work round this by doing

export NODE_EXTRA_CA_CERTS=ca-cert/ca-cert.crt

npm i warnings

npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN prefer global [email protected] should be installed with -g

maybe related to #16 ?

errors when installing cldr-data

Hi,
I am experiencing problems when installing cldr-data. Is it a known issue?

What I am trying to do: npm install cldr-data

What I am getting in the console:

npm ERR! code 1
npm ERR! path C:\Projects\Fenetre.SiliconCore\Source\node_modules\cldr-data
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node install.js
npm ERR! GET https://github.com/unicode-cldr/cldr-core/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-dates-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-buddhist-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-chinese-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-coptic-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-dangi-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-ethiopic-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-hebrew-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-indian-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-islamic-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-japanese-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-persian-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-cal-roc-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-localenames-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-misc-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-numbers-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-segments-modern/archive/36.0.0.zip
npm ERR! GET https://github.com/unicode-cldr/cldr-units-modern/archive/36.0.0.zip
npm ERR! Whops Error making request.
npm ERR! Error: connect ETIMEDOUT 140.82.121.3:443
npm ERR! at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16)
npm ERR!
npm ERR! Please report this full log at https://github.com/rxaviers/cldr-data-downloader

npm ERR! A complete log of this run can be found in: C:\Users\andrewm\AppData\Local\npm-cache_logs\2023-06-29T18_11_38_091Z-debug-0.log

Node.js: 18.12.1
NPM: 9.5.0

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.