gitbook-cli icon indicating copy to clipboard operation
gitbook-cli copied to clipboard

Forcing a specific version of gitbook using --gitbook throws errors

Open detj opened this issue 6 years ago • 3 comments

Trying gitbook build ./docs --gitbook=2.0.0, throws the following error

Error loading version latest: Error: Cannot find module 'internal/util/types'
    at Function.Module._resolveFilename (module.js:557:15)
    at Function.Module._load (module.js:484:25)
    at Module.require (module.js:606:17)
    at require (internal/module.js:11:18)
    at evalmachine.<anonymous>:31:26
    at Object.<anonymous> (/Users/detj/.gitbook/versions/2.0.0/node_modules/graceful-fs/fs.js:11:1)
    at Module._compile (module.js:662:30)
    at Object.Module._extensions..js (module.js:673:10)
    at Module.load (module.js:575:32)
    at tryModuleLoad (module.js:515:12)

TypeError: Cannot read property 'commands' of null

I do have the 2.0.0 version installed using gitbook fetch 2.0.0.

Running gitbook ls returns

$ gitbook ls
GitBook Versions Installed:

    * 3.2.3
      2.0.0

Run "gitbook update" to update to the latest version.

Also, the --gitbook option doesn't show up in gitbook help under the build sub-command. Is build the only command that accepts --gitbook option?

my gitbook version

$ gitbook --version
CLI version: 2.3.2
GitBook version: 3.2.3

detj avatar Mar 04 '18 10:03 detj