lexiross / fattest-cat

Script to find fattest cat currently up for adoption at SF SPCA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError('Incorrect value of args option') opening cat profile

dgcoffman opened this issue · comments

Using node 7.7.2.

dgc@deathtron:~/flavortown$ npm install -g fattest-cat; fattest-cat
/usr/local/bin/fattest-cat -> /usr/local/lib/node_modules/fattest-cat/index.js
/usr/local/lib
└── fattest-cat@1.0.9

Accessing San Francisco SPCA (Cat Department)...
Cat information system accessed. 28 cats found. Beginning weighing process...
Weighing cat: Callie
...
Weighing cat: Jesse
The fattest cat is Mr. Sheffield. He weighs 17 lbs and 10 oz.. Opening cat profile...
child_process.js:146
    throw new TypeError('Incorrect value of args option');
    ^

TypeError: Incorrect value of args option
    at Object.exports.execFile (child_process.js:146:11)
    at opener (/usr/local/lib/node_modules/fattest-cat/node_modules/opener/opener.js:46:25)
    at arrayEach (/usr/local/lib/node_modules/fattest-cat/node_modules/lodash/lodash.js:537:11)
    at Function.forEach (/usr/local/lib/node_modules/fattest-cat/node_modules/lodash/lodash.js:9359:14)
    at LodashWrapper.object.(anonymous function) [as each] (/usr/local/lib/node_modules/fattest-cat/node_modules/lodash/lodash.js:15693:25)
    at Timeout.setTimeout [as _onTimeout] (/usr/local/lib/node_modules/fattest-cat/index.js:83:48)
    at ontimeout (timers.js:380:14)
    at tryOnTimeout (timers.js:244:5)
    at Timer.listOnTimeout (timers.js:214:5)

.map(opener) passes currentValue, index, array to opener, which causes it to mess up.

fix with

setTimeout(() => _(fattestCats).map("url").each((url) => opener(url)), 3000);