wallabag / doc

Documentation repository for wallabag v2.
https://doc.wallabag.org
23 stars 59 forks source link

Unable to install on mac os #165

Open mstevens opened 1 year ago

mstevens commented 1 year ago

HI, I tried to install this on mac os following the install instructions but yarn gitbook install failed:

michaelstevens@Michaels-MacBook-Air doc % yarn gitbook install
yarn run v1.22.19
warning package.json: No license field
warning ../package.json: No license field
$ /Users/michaelstevens/doc/node_modules/.bin/gitbook install
Installing GitBook 3.2.3
/Users/michaelstevens/doc/node_modules/npm/node_modules/graceful-fs/polyfills.js:287
      if (cb) cb.apply(this, arguments)
                 ^

TypeError: cb.apply is not a function
    at /Users/michaelstevens/doc/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqCallback.oncomplete (node:fs:191:5)

Node.js v19.3.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I tested node 18 to see if it made a difference:

michaelstevens@Michaels-MacBook-Air doc % yarn gitbook install
yarn run v1.22.19
warning package.json: No license field
warning ../package.json: No license field
$ /Users/michaelstevens/doc/node_modules/.bin/gitbook install
Installing GitBook 3.2.3
/Users/michaelstevens/doc/node_modules/npm/node_modules/graceful-fs/polyfills.js:287
      if (cb) cb.apply(this, arguments)
                 ^

TypeError: cb.apply is not a function
    at /Users/michaelstevens/doc/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqCallback.oncomplete (node:fs:208:5)

Node.js v18.12.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

gitbook-cli looked abandoned so I managed to get something generating with this diff:

diff --git a/book.json b/book.json
index 6f6098a..843a696 100644
--- a/book.json
+++ b/book.json
@@ -2,7 +2,6 @@
     "plugins": [
         "edit-link",
         "toggle-chapters",
-        "page-toc",
         "-sharing",
         "versions",
         "hints",
diff --git a/package.json b/package.json
index 4ce3c73..6d9efb0 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,11 @@
 {
   "dependencies": {
-    "gitbook-cli": "^2.3.2"
+    "gitbook-plugin-edit-link": "^2.0.2",
+    "gitbook-plugin-hints": "^1.0.2",
+    "gitbook-plugin-localized-footer": "^0.3.1",
+    "gitbook-plugin-page-toc": "^1.1.1",
+    "gitbook-plugin-toggle-chapters": "^0.0.3",
+    "gitbook-plugin-versions": "^2.1.4",
+    "honkit": "^4.0.4"
   }
 }

(note it becomes yarn honkit serve to run a local server)

but I do get a bunch of warnings so not totally happy with it.

j0k3r commented 1 year ago

We know gitbook is abandoned. The build to deploy the doc is using node v10.24.1. Give a try maybe

mstevens commented 1 year ago

It's difficult to find a node that old! But yes it did work when I found one.

mstevens commented 1 year ago

Did a better version of the change to use honkit on a fork: https://github.com/wallabag/doc/commit/f4c614c8172724092b41905f78fdef774f6a0bb9

Looks (nearly) identical to me and works in current node.