Modular-Dev / format-phone

Convert text to international friendly phone number format
MIT License
3 stars 5 forks source link

npm module broken (missing `./resources/en/country_names`) #1

Open jeffreywescott opened 8 years ago

jeffreywescott commented 8 years ago
[jeffrey@smile tmp]$ npm install --save format-phone
tmp@0.1.0 /Users/jeffrey/dev/learnersguild/idm
├─┬ format-phone@0.0.5
  └── google-libphonenumber@1.0.15

[jeffrey@smile tmp]$ node
> var phoneFormat = require('format-phone');
Error: Cannot find module './resources/en/country_names'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/Users/jeffrey/dev/learnersguild/tmp/node_modules/format-phone/lib/phone-number-parser.js:13:18)
    at Object.<anonymous> (/Users/jeffrey/dev/learnersguild/tmp/node_modules/format-phone/lib/phone-number-parser.js:149:4)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
> var parsednumber = phoneFormat.parsePhoneNumber('212-555-1234', 'US');
TypeError: Cannot read property 'parsePhoneNumber' of undefined
    at repl:1:31
    at REPLServer.defaultEval (repl.js:252:27)
    at bound (domain.js:287:14)
    at REPLServer.runBound [as eval] (domain.js:300:12)
    at REPLServer.<anonymous> (repl.js:417:12)
    at emitOne (events.js:95:20)
    at REPLServer.emit (events.js:182:7)
    at REPLServer.Interface._onLine (readline.js:211:10)
    at REPLServer.Interface._line (readline.js:550:8)
    at REPLServer.Interface._ttyWrite (readline.js:827:14)
> console.log(parsednumber);
undefined
undefined
>
dijs commented 8 years ago

Yes, Why is this not included in the source?

jpmoyn commented 7 years ago

+1

It was annoying having to go to the repo to manually grab the json file. Seems like an easy fix for the maintainer.