moos / wordpos

Part-of-speech utilities for node.js based on the WordNet database.
477 stars 41 forks source link

Broken npm install in nodejs v4.4.0 #10

Closed kengz closed 8 years ago

kengz commented 8 years ago

On node v4.4.0 on Ubuntu 14.04, if a project specifies wordpos as dependency, on running npm install it will wrongfully not install wordnet-db first, causing the error below. This does not happen on node v5.x. Tested the issue on both travis and server Ubuntu VMs.

The travis log is here. The VM log (same error) is below.

root@raw-test:~/aiva# npm i

> wordpos@1.0.1 postinstall /root/aiva/node_modules/wordpos
> node tools/stat.js --no-stats index.adv index.adj index.verb index.noun

fs.js:808
  return binding.readdir(pathModule._makeLong(path));
                 ^

Error: ENOENT: no such file or directory, scandir '/root/aiva/node_modules/wordnet-db/dict'
    at Error (native)
    at Object.fs.readdirSync (fs.js:808:18)
    at Object.<anonymous> (/root/aiva/node_modules/wordnet-db/index.js:4:31)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/root/aiva/node_modules/wordpos/src/wordpos.js:16:10) 
moos commented 8 years ago

Not sure I can do much about this since dependencies are clearly defined. May be a quirk of the particular versions involved. As a work around you might try adding "wordnet-db": "latest" to the dependencies at the root package.

kengz commented 8 years ago

Yup the failure above matters only in 'travis, in which case it can be solved by addnpm install wordnet-dbinpreinstallin.travis.yml. In normal use cases we can manually installwordnet` first if we recognize the issue.