node-slug icon indicating copy to clipboard operation
node-slug copied to clipboard

Cannot find module 'unicode/category/So'

Open ralyodio opened this issue 9 years ago • 17 comments

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)

ralyodio avatar Dec 30 '15 06:12 ralyodio

Hmmm, I get this on my Mac as well.

kenotron avatar Jan 02 '16 05:01 kenotron

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

ralyodio avatar Jan 02 '16 09:01 ralyodio

After npm install unicode, the problem is still here (Ubuntu 14.04, node 4.2.2, npm 2.14.7). It's [email protected].

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

parmentf avatar Mar 03 '16 16:03 parmentf

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

npm install unicode not work for me.

haishanh avatar Mar 23 '16 01:03 haishanh

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

rvanzon avatar Mar 24 '16 11:03 rvanzon

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.

htor avatar Apr 15 '16 13:04 htor

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

simison avatar Apr 15 '16 14:04 simison

@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

1yx avatar Aug 23 '16 03:08 1yx

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

nalbion avatar Aug 26 '16 07:08 nalbion

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

rajendrakhabiyagate6 avatar Nov 29 '16 12:11 rajendrakhabiyagate6

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

antoinedejonckheere avatar Dec 20 '16 11:12 antoinedejonckheere

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:

  • (installed unicdoe-data successfully but didn't resolve the issue) sudo apt-get install unicode-data
  • (succeeded but didn't resolve the issue) cd /tmp && wget http://unicode.org/Public/UNIDATA/UnicodeData.txt then export NODE_UNICODETABLE_UNICODEDATA_TXT=/tmp/UnicodeData.txt

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

dylanjha avatar Dec 20 '16 22:12 dylanjha

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

dylanjha avatar Dec 20 '16 22:12 dylanjha

@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?

antoinedejonckheere avatar Dec 21 '16 08:12 antoinedejonckheere

@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 avatar Dec 21 '16 08:12 dylanjha

@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

dylanjha avatar Dec 21 '16 09:12 dylanjha

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

antoinedejonckheere avatar Dec 21 '16 14:12 antoinedejonckheere