drapanjanas/re-natal

re-natal require-all not working in re-natal 0.10.0

philoskim opened this issue · 4 comments

I encountered the following error in re-natal 0.10.0

$ re-natal init demo

$ cd demo

$ re-natal require-all
/home/philos/.local/node/lib/node_modules/re-natal/re-natal.coffee:1098
    addedModules = new Set(newModules.filter(function(m) {
                                      ^

TypeError: Cannot read property 'filter' of undefined
    at logModuleDifferences (/home/philos/.local/node/lib/node_modules/re-natal/re-natal.coffee:889:37)
    at inferComponents (/home/philos/.local/node/lib/node_modules/re-natal/re-natal.coffee:902:3)
    at Command.<anonymous> (/home/philos/.local/node/lib/node_modules/re-natal/re-natal.coffee:1009:5)
    at Command.listener (/home/philos/.local/node/lib/node_modules/re-natal/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:182:13)
    at Command.parseArgs (/home/philos/.local/node/lib/node_modules/re-natal/node_modules/commander/index.js:654:12)
    at Command.parse (/home/philos/.local/node/lib/node_modules/re-natal/node_modules/commander/index.js:474:21)
    at Object.<anonymous> (/home/philos/.local/node/lib/node_modules/re-natal/re-natal.coffee:1053:7)
    at Object.<anonymous> (/home/philos/.local/node/lib/node_modules/re-natal/re-natal.coffee:1:1)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.loadFile (/home/philos/.local/node/lib/node_modules/re-natal/node_modules/coffeescript/lib/coffeescript/register.js:18:19)
    at Module.load (/home/philos/.local/node/lib/node_modules/re-natal/node_modules/coffeescript/lib/coffeescript/register.js:53:36)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/philos/.local/node/lib/node_modules/re-natal/index.js:4:1)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)

Please refer to #205

The klaw-sync version 5.0.0 has a problem that if the filter doesn't pass, the subdirectories wouldn't be checked

I ran the following commands according to the advice and succeeded.

Thank you for this solution!

$ npm install klaw-sync -g

$ re-natal {traverseAll: true} require-all

Problem is still there.

Giving the option parameters is not working: bash doesn't handle first argument.