nature-of-code / noc-book

The Nature of Code book (archived repo, see README for new repo / build system!)
http://natureofcode.com
1.94k stars 365 forks source link

Can't build the book: ERR_INVALID_ARG_TYPE #147

Closed cj1128 closed 6 years ago

cj1128 commented 6 years ago

I got this error when built the book:

Config file detected: magicbook.json
buffer.js:195
    throw new errors.TypeError(
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type null
    at Function.from (buffer.js:195:11)
    at new Buffer (buffer.js:170:17)
    at DestroyableTransform._transform (/Users/cj/node_modules/magicbook/src/plugins/ids.js:59:25)
    at DestroyableTransform.Transform._read (/Users/cj/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/Users/cj/node_modules/readable-stream/lib/_stream_transform.js:172:83)
    at doWrite (/Users/cj/node_modules/readable-stream/lib/_stream_writable.js:428:64)
    at writeOrBuffer (/Users/cj/node_modules/readable-stream/lib/_stream_writable.js:417:5)
    at DestroyableTransform.Writable.write (/Users/cj/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at DestroyableTransform.ondata (/Users/cj/Documents/The-Nature-of-Code/node_modules/readable-stream/lib/_stream_readable.js:619:20)
    at DestroyableTransform.emit (events.js:180:13)

I think it's caused by magicbook api change, cause magicbook is under active development.

What magicbook version did you use?

I think it's better to make magicbook a dependency in package.json rather than install it globally. Then we can all get the same version. :D

tim-hilt commented 6 years ago

This issue is related to magicbook! It works with this version:

npm i -g magicbook@0.1.16

cj1128 commented 6 years ago

Thanks! It worked.