Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't require #29

Closed
josip opened this issue Mar 18, 2016 · 3 comments
Closed

Can't require #29

josip opened this issue Mar 18, 2016 · 3 comments

Comments

@josip
Copy link

josip commented Mar 18, 2016

Just did npm install fontkit, and tried to require it in node CLI but got this:

> require('fontkit');
TypeError: Cannot call method 'replace' of undefined
    at Object.<anonymous> (/Users/josip/tmp/node_modules/fontkit/node_modules/brotli/build/decode.js:2:462)
    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)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/josip/tmp/node_modules/fontkit/node_modules/brotli/decompress.js:1:76)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)

I'm using node 0.10.4 on OS X 10.11. I'm guessing I'm using a too old version of node?

@devongovett
Copy link
Member

It is emscripten being stupid again. It is looking for the program name (normally process.argv[1]), but there is none since you just typed node without an argument. It works outside the cli. I'm working to move away from emscripten for brotli decoding.

@Pomax
Copy link
Contributor

Pomax commented Mar 18, 2016

However, that said, yes: 0.10 is too old =) v0.12 is about to fall out of its LTS periodd, so you want to be on v4.x (current long-term-support version is 4.4) or 5.x (current stable being 5.9)

@devongovett
Copy link
Member

This should be fixed if you re-install. We're using a hand ported pure JS brotli decoder now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants