dodo / node-slug

slugifies even utf-8 chars!
MIT License
1.07k stars 94 forks source link

Cannot find module 'unicode/category/So' #58

Open ralyodio opened 8 years ago

ralyodio commented 8 years ago

Cannot find module 'unicode/category/So'

it craps out on the const slug = require('slug') statement. it works fine on mac. but debian and ubuntu both throw this error

heres the full error:

module.js:328
    throw err;
    ^

Error: Cannot find module 'unicode/category/So'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at symbols (/home/username/lib/node_modules/slug/slug.js:6:16)
    at /home/username/lib/node_modules/slug/slug.js:199:5
    at Object.<anonymous> (/home/username/lib/node_modules/slug/slug.js:212:2)
    at Module._compile (module.js:398:26)
    at Object.Module._extensions..js (module.js:405:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/username/lib/config/mylib.js:4:12)
    at Module._compile (module.js:398:26)
    at Object.Module._extensions..js (module.js:405:10)
kenotron commented 8 years ago

Hmmm, I get this on my Mac as well.

ralyodio commented 8 years ago

I just did npm install unicode and that fixed the problem. I think something along the line is missing that as a dependency.

parmentf commented 8 years ago

After npm install unicode, the problem is still here (Ubuntu 14.04, node 4.2.2, npm 2.14.7). It's unicode@0.6.1.

ll node_modules/unicode/category/
total 28
drwxr-xr-x 2 parmentf utilisa. du domaine 4096 mars   3 17:27 ./
drwxr-xr-x 4 parmentf utilisa. du domaine 4096 mars   3 17:27 ../
-rw-r--r-- 1 parmentf utilisa. du domaine  210 mars   3 17:27  font-family: Tahoma, Roya, sans-serif.js
-rw-r--r-- 1 parmentf utilisa. du domaine   89 nov.  19  2013 README
-rw-r--r-- 1 parmentf utilisa. du domaine 8242 mars   3 17:27 undefined.js
haishanh commented 8 years ago

I meet the same problem on Cent OS 7 / node 5.6.0 / npm 3.6.0

npm install unicode not work for me.

rvanzon commented 8 years ago

@haishanh run it in node_modules/slug. It's dirty, but it does the trick.

htor commented 8 years ago

I'm getting this error too, on my Debian 8.2 box. Didn't get it when running locally on my Mac. Using node v5.10.1 and npm 3.8.3.

Used npm install unicode as a workaround.

simison commented 8 years ago

Could this have something to do with this:

# debian
sudo apt-get install unicode-data # optional
# gentoo
sudo emerge unicode-data # optional

npm install unicode

If you have problems installing UnicodeData.txt because unicode.org is down or you're behind a proxy, try installing unicode-data via your system package installer.

https://www.npmjs.com/package/unicode#install

1yx commented 8 years ago

@parmentf try download UnicodeData.txt somewhere else. cd /tmp && wget http://unicode.org/Public/UNIDATA/UnicodeData.txt export NODE_UNICODETABLE_UNICODEDATA_TXT=/tmp/UnicodeData.txt then npm install unicode gonna work well. image

nalbion commented 8 years ago

There is a pending PR which will resolve this - https://github.com/dodo/node-unicodetable/pull/22

rajendrakhabiyagate6 commented 7 years ago

If you are facing this issue and you are behind windows please follow below steps, i hope worked for you :

  1. Remove the unicode module using npm, npm remove unicode
  2. Downloaded the file from http://unicode.org/Public/UNIDATA/UnicodeData.txt and placed it into C:\usr\share\unicode-data\ if your project is in C drive, or if you are using linux place it in /usr/share/unicode or /usr/share/unicode-data
  3. Installed unicode again
antoinedejonckheere commented 7 years ago

I'm still facing this issue while deploying my app to heroku. None of the above proposed quick fixes is working ... Any idea?

dylanjha commented 7 years ago

Running into this on circleci, I assume because circle installs from behind a proxy: https://discuss.circleci.com/t/node-cannot-find-module-unicode-category-so/8990

I tried the options from the install section https://github.com/dodo/node-unicodetable#install:

Hoping this PR lands, which should resolve this issue entirely https://github.com/dodo/node-unicodetable/pull/22

dylanjha commented 7 years ago

@antoinedejonckheere trying setting the env variable NODE_MODULES_CACHE=false in your Heroku environment, see if that works for you

antoinedejonckheere commented 7 years ago

@dylanjha amazing, it worked. My interpretation then is that for one deployment, the install was unsuccessful. Next installations were then using the cached version of the package (which was failing), correct?

dylanjha commented 7 years ago

@antoinedejonckheere I thought that at first too, but I don't think that is it. If you re-enable the cache it will fail again. To be honest, I don't have an explanation, maybe someone else can chime in if they know.

dylanjha commented 7 years ago

@antoinedejonckheere also, if converting unicode isn't important to you, check out this module, which doesn't rely on unicode (unicode characters get removed instead of converted) https://www.npmjs.com/package/slugs

antoinedejonckheere commented 7 years ago

@dylanjha thanks, moving to another package was indeed what I decided to do :) thanks again for your kind help