GitbookIO / gitbook-cli

GitBook's command line interface
716 stars 217 forks source link

TypeError: Cannot read property 'pipesCount' of undefined #113

Open 2snoopy88 opened 3 years ago

2snoopy88 commented 3 years ago

$ gitbook serve Live reload server started on port: 35729 Press CTRL+C to quit ...

info: 7 plugins are installed info: loading plugin "livereload"... OK info: loading plugin "highlight"... OK info: loading plugin "search"... OK info: loading plugin "lunr"... OK info: loading plugin "sharing"... OK info: loading plugin "fontsettings"... OK info: loading plugin "theme-default"... OK info: found 1 pages info: found 0 asset files _stream_readable.js:638 if (state.pipesCount === 1) { ^

TypeError: Cannot read property 'pipesCount' of undefined at ReadStream.Readable.pipe (_stream_readable.js:638:13) at C:\Users\Asde.gitbook\versions\3.2.3\node_modules\cpr\lib\index.js:163:2 2 at callback (C:\Users\Asde\AppData\Roaming\npm\node_modules\gitbook-cli\node _modules\npm\node_modules\graceful-fs\polyfills.js:295:20) at FSReqCallback.oncomplete (fs.js:168:21)

Bakhtiar-Sadeghi commented 3 years ago

please use


npm install gitbook-cli@2.1.2 --global
ritenseki commented 3 years ago

thank you! my problem has been solved.

zhang-fork commented 3 years ago

Systemarchlinux

I can not uninstall the gitbook CLI version: 2.3.2 with

npm uninstall gitbook-cli -g ,

and then run

npm install gitbook-cli@2.1.2 --global

nothing happened.

I sloved it by

cd ~/.gitbook/versions/3.2.3/node_modules/npm/node_modules/
vim package.json 

change the version of graceful-fs to 4.2.0,and then

npm install

after that, everything is ok.

what's more, my node version is 12.22 , if node version is 14 up, that may cause other problems.

ghost commented 3 years ago

@zhang-fork Thank you it works 😆

kadashu commented 3 years ago
# MacOS 10.15.7
# npm --version
# 6.14.11
# node --version
# v14.16.0

cd /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules && \
  npm install graceful-fs@4.2.0 --save

works for me , thx @zhang-fork