Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

october-devをビルドできるようにする #226

Open
arowM opened this issue Nov 4, 2020 · 5 comments
Open

october-devをビルドできるようにする #226

arowM opened this issue Nov 4, 2020 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@arowM
Copy link
Member

arowM commented Nov 4, 2020

ヒント:
#170 (comment)

@arowM arowM added the help wanted Extra attention is needed label Nov 4, 2020
@negiboudu
Copy link
Contributor

#194
も関係あったりしますか…?

@arowM
Copy link
Member Author

arowM commented Nov 6, 2020

関係ありますね!
ありがとうございます🌻

@negiboudu
Copy link
Contributor

negiboudu commented Dec 9, 2020

本件と関係があるかはわかりませんが、新しいMacを買ったのでビルドする環境を作り直したところ、エラーが発生してビルドできませんでした。
guideディレクトリに移動してnpm iした結果です。

TypeError: cb.apply is not a function
    at /Users/suzukikatsuaki/guide/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqCallback.oncomplete (fs.js:184:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! guide@1.0.0 install-gitbook: `replace --silent ',"elm-repl"' '' book.json && gitbook install && replace --silent '"youtube"' '"youtube","elm-repl"' book.json`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the guide@1.0.0 install-gitbook script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/suzukikatsuaki/.npm/_logs/2020-12-09T17_51_52_791Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! guide@1.0.0 postinstall: `npm run install-gitbook && npm run install-repl`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the guide@1.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/suzukikatsuaki/.npm/_logs/2020-12-09T17_51_52_860Z-debug.log

https://teratail.com/questions/279576
node.jsのバージョンを落としたらうまくいったという事例がありましたが自分の環境ではうまくいきませんでした。
v12、v14、v15を試しました。

GitbookIO/gitbook-cli#110 (comment)
ここに書いてある通り、graceful-fsのバージョンを上げたらnpm iは動くようになりましたが、
npm startしたところ、別のエラーが出ました。

suzukikatsuaki@suzukikatsuakinoMacBook-Air guide % npm start

> guide@1.0.0 start /Users/suzukikatsuaki/guide
> gitbook --port 8007 serve

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

info: 13 plugins are installed 
info: 11 explicitly listed 
info: loading plugin "youtube"... OK 
info: loading plugin "elm-repl"... OK 
info: loading plugin "bulk-redirect"... OK 
info: loading plugin "ga"... OK 
info: loading plugin "sitemap"... OK 
info: loading plugin "livereload"... OK 
info: loading plugin "highlight"... OK 
info: loading plugin "search"... OK 
info: loading plugin "lunr"... OK 
info: loading plugin "fontsettings"... OK 
info: loading plugin "theme-default"... OK 
info: found 41 pages 
info: found 23 asset files 
_stream_readable.js:649
  if (state.pipes.length === 1) {
            ^

TypeError: Cannot read property 'pipes' of undefined
    at ReadStream.Readable.pipe (_stream_readable.js:649:13)
    at /Users/suzukikatsuaki/.gitbook/versions/3.2.3/node_modules/cpr/lib/index.js:163:22
    at callback (/Users/suzukikatsuaki/guide/node_modules/npm/node_modules/graceful-fs/polyfills.js:295:20)
    at FSReqCallback.oncomplete (fs.js:183:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! guide@1.0.0 start: `gitbook --port 8007 serve`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the guide@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/suzukikatsuaki/.npm/_logs/2020-12-09T20_18_45_908Z-debug.log

まだ解消できていませんが、ひとまず状況の共有でした。

@negiboudu
Copy link
Contributor

ビルドできました!
結局Node.jsのバージョンを落としただけでうまくいきました。

ビルド成功したときのバージョン

~ % node -v
v10.23.0
~ % npm -v 
6.14.8

すべてのバージョンを試したわけではありませんが、おそらくNode.jsのv12以降を使うとエラーになるのだろうと思われます。

@arowM
Copy link
Member Author

arowM commented Dec 11, 2020

僕の環境だとnode v13.6.0 でそのままビルドできちゃっているので、なにか環境との組み合わせもありそうですね!

とはいえ、nodeのバージョンを全員であわせたほうが無難なので、package.jsondependenciesnodeを入れちゃうハックをしたプルリクを作成しました。
#237

これなら、グローバルインストールされたnodeのバージョンに関わらずビルドできるようになるんじゃないかなって思います!
もしお試しいただくなら、node_modulesを削除した上でnpm iから試していただく必要があります🌸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants