rxaviers / cldr-data-npm

Npm module for Unicode CLDR JSON data
MIT License
42 stars 28 forks source link

npm install crashing on install.js script with missing modules #11

Closed focusaurus closed 9 years ago

focusaurus commented 9 years ago

Been unable to install cldr-data recently. The npm error indicates an issue with the cldr-data install script, but I'm also seeing some npm weirdness perhaps due to the EC2 US West outage yesterday/today. CC @tinganho because it's ultimately l10ns I'm trying to install.

ubuntu@host:~$ mkdir /tmp/d
ubuntu@host:~$ cd /tmp/d
ubuntu@host:/tmp/d$ npm install l10ns
/
> cldr-data@26.0.10 install /tmp/d/node_modules/l10ns/node_modules/cldr-data
> node install.js

module.js:340
    throw err;
          ^
Error: Cannot find module 'boom'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/tmp/d/node_modules/l10ns/node_modules/request/node_modules/hawk/lib/index.js:3:33)
    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)
npm ERR! cldr-data@26.0.10 install: `node install.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the cldr-data@26.0.10 install script.
npm ERR! This is most likely a problem with the cldr-data package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls cldr-data
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.2.0-77-virtual
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "l10ns"
npm ERR! cwd /tmp/d
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
focusaurus commented 9 years ago

FYI I also reproduced on the latest node/npm: npm ERR! node v0.12.0 npm ERR! npm v2.5.1

rxaviers commented 9 years ago

I could not reproduce the error.

$ npm install cldr-data
|
> cldr-data@26.0.10 install /tmp/x/node_modules/cldr-data
> node install.js

GET `http://www.unicode.org/Public/cldr/26.0.1/json.zip`
  [========================================] 100% 0.0s
Received 3424K total.
Unpacking it into `./`
cldr-data@26.0.10 node_modules/cldr-data
└── cldr-data-downloader@0.1.2 (progress@1.1.8, q@1.0.1, adm-zip@0.4.4, request-progress@0.3.1, nopt@3.0.1, mkdirp@0.5.0, npmconf@2.0.9, request@2.53.0)
$ npm --version
2.6.0
$ node --version
v0.12.0

Can you try cleaning your ~/.npm cache and installing npm install cldr-data?

tinganho commented 9 years ago

@focusaurus @rxaviers I know what the problem is. I have the request npm module and somehow it is interfering with the installation. There is nothing wrong with cldr-data-npm. I have fixed this issue now on l10ns.

rxaviers commented 9 years ago

Thanks @tinganho, so I'm closing the issue here.

focusaurus commented 9 years ago

Awesome, @tinganho thanks for the quick fix. This was preventing me from getting my l10ns-ized app in front of clients.

puzrin commented 9 years ago
make[1]: Leaving directory `/tmp/nodeca.core-1427049395'
cd /tmp/nodeca.core-1427049395 && npm install

> cldr-data@26.0.10 install /tmp/nodeca.core-1427049395/node_modules/cldr-data
> node install.js

module.js:340
    throw err;
          ^
Error: Cannot find module './lib'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/tmp/nodeca.core-1427049395/node_modules/request/node_modules/hawk/node_modules/boom/index.js:1:80)
    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)

https://travis-ci.org/nodeca/nodeca.core/builds/55388011

I have this problem too. Solved with kludge by separate run npm install cldr-data before everything. It works, and then consequent npm install doesn't breaks.

May be worth to reopen this ticket?

rxaviers commented 9 years ago

I will let @tinganho to confirm.

tinganho commented 9 years ago

I don't think I have any problem with cldr-data-npm anymore. But whatever it is causing this — My guess is NPM:s fault.

puzrin commented 9 years ago

May be, mark clrd-data-downloader dependencies as bundled?

rxaviers commented 9 years ago

@puzrin it's still not clear to me what the cause of the problem was and how your suggestion will fix it. Please, could you expand on that? Thanks

puzrin commented 9 years ago

http://stackoverflow.com/questions/11207638/advantages-of-bundleddependencies-over-normal-dependencies-in-npm

(It's only guess) may be npm optimizes dependencies dirs with moving some deps to upper level. If that happens on download, we can get "notfound" reports. Note, that missed files are different in first one and my messages. I've received different "missed files" errors.

My suggestion was to freeze dependencies by bundling those into package. Don't know, will it help or not.

focusaurus commented 9 years ago

I think bundledDependencies is best avoided for re-usable libraries. It might be OK for some applications that are not re-usable, but for most npm packages, using it seems to defeat the purpose of npm at least partially.

rxaviers commented 9 years ago

@puzrin and @focusaurus I very much appreciate your contribution. Bu, if you think there's something that needs to be changed I need you to provide a very simply statement saying what's the current problem, how it should be fixed, and the impacts involved. I'm sorry not being able to read it through the links to figure out.

puzrin commented 9 years ago

@rxaviers that bug was not stable. I could not reproduce it locally, it happened only on travis for me.

rxaviers commented 9 years ago

Ok, so I assume let's keep things as they are. Just let me know otherwise. Thank you.