dodo / node-unicodetable

unicode lookup table
MIT License
42 stars 34 forks source link

overcoming UnicodeTable.txt download #19

Open mcharytoniuk opened 9 years ago

mcharytoniuk commented 9 years ago

I am not the package maintainer but I'll leave this info here because it may be useful:

The other way to overcome UnicodeTable.txt download problems under corporate networks, weird proxies, etc is to download everyting manually and distribute "unicode" under "bundledDependencies" in package.json:

{
  "bundledDependencies": [
    "unicode"
  ]
}

Then just place unicode package with downloaded UnicodeTable.txt and generated category dir under your project's node_modules and keep it versioned (actually package.json file and category directory is enough for unicode to work).

I hope it helps someone. I think it can be also mentioned in a README.

ltanme commented 8 years ago

try to read file /usr/share/unicode/UnicodeData.txt … /usr/share/unicode/UnicodeData.txt not found. try to read file /usr/share/unicode-data/UnicodeData.txt … /usr/share/unicode-data/UnicodeData.txt not found. try to read file UnicodeData.txt … UnicodeData.txt not found. try to download … GET unicode.org:80/Public/UNIDATA/UnicodeData.txt request timed out.

mac pro os x node install.js not work

tereska commented 8 years ago

same thing again could you do something with this?

curl -vvv -s -i 'http://unicode.org:80/Public/UNIDATA/UnicodeData.txt'
* About to connect() to unicode.org port 80 (#0)
*   Trying 216.97.88.9... Connection timed out
* couldn't connect to host
* Closing connection #0
leinonen commented 8 years ago

Why not bundle the file with the lib? This is really annoying..

mrj04 commented 8 years ago

update the install.js by replacing this code :

unicodedatafile = { host: "unicode.org",

By this code : unicodedatafile = { host: "http://unicode.org",

xusai2014 commented 7 years ago

Finally, how to solve the questions on MacOs?

guyellis commented 7 years ago

I've started hitting this timeout issue a lot on a Travis build:

> unicode@0.6.1 postinstall /home/travis/build/guyellis/plant/node_modules/unicode
> node install.js
try to read file /usr/share/unicode/UnicodeData.txt …
/usr/share/unicode/UnicodeData.txt not found.
try to read file /usr/share/unicode-data/UnicodeData.txt …
/usr/share/unicode-data/UnicodeData.txt not found.
try to read file UnicodeData.txt …
UnicodeData.txt not found.
try to download …
GET unicode.org:80/Public/UNIDATA/UnicodeData.txt
request timed out.

Any ideas why Travis would be timing out?

mwj8410 commented 7 years ago

I doubt that it is limited to your Travis environment. When it happens, try getting the file in your web browser. The file is simply not reliably available at that location.

You have two option:

  1. remove the dependency (considering how stale this lib is, I recommend that)
  2. Implement some hack to bypass the flaw
srl295 commented 7 years ago

^ cause above is your host being blacklisted for excess downloads, see #16