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

error in using gitbook init #1818

Closed
harwinvoid opened this issue Jul 12, 2017 · 13 comments
Closed

error in using gitbook init #1818

harwinvoid opened this issue Jul 12, 2017 · 13 comments

Comments

@harwinvoid
Copy link

I install the latest version of gitbook-cli@3.2.2, but i get a error like below:

➜  workspace gitbook init
Error loading version latest: Error: Cannot find module 'extend'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/harwin/.gitbook/versions/3.2.2/lib/index.js:1:76)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

TypeError: Cannot read property 'commands' of null

my node js version and npm version is:

➜  workspace npm -v
3.10.10
➜  workspace node -v
v6.11.0
@harwinvoid harwinvoid changed the title error in use gitbook init error in using gitbook init Jul 12, 2017
@oblador
Copy link

oblador commented Jul 12, 2017

Getting the same issue with on both node 7, 8 and with both yarn and npm.

@grmpyninja
Copy link

It's not only with gitbook init but with other commands as well.

Tried to use this docker https://hub.docker.com/r/fellah/gitbook/ and I switched between node:6-slim, 8-slim and full 8 and same error while gitbook build as well as gitbook serve

@AaronO
Copy link

AaronO commented Jul 12, 2017

This seems to a regression in gitbook-cli@2.3.1 caused by GitbookIO/gitbook-cli#60

@ghost
Copy link

ghost commented Jul 12, 2017

Downgrading to 2.3.0 doesn't seem to fix the issue.

@oblador
Copy link

oblador commented Jul 12, 2017

cd ~/.gitbook/versions/3.2.2 && npm i solved it for me

@ghost
Copy link

ghost commented Jul 12, 2017

Great! It solved it for both @2.3.0 and @2.3.1

@saun4app
Copy link

saun4app commented Jul 12, 2017

Thanks to @oblador, cd ~/.gitbook/versions/3.2.2 && npm i fixed the issue for gitbook init. However, I still get the same error message for gitbook serve and gitbook build.

Update: Actually, cd ~/.gitbook/versions/3.2.2 && npm i helps get around the issue for 'init', 'serve', and 'build'. I had to run , cd ~/.gitbook/versions/3.2.2 && npm i after installing a new package (at book directory).

Also, @AaronO's comment makes sense. The issues stated after I upgraded to npm@5.

@AaronO
Copy link

AaronO commented Jul 12, 2017

@oblador Thanks for posting that workaround, but ideally we should get it fixed in the core.

It seems like npm@5 no longer installs or can be used as a lib to install deps as we expect it to (and that worked with npm@3).

@cpsubrian
Copy link

Reverting to 2.3.0 worked for me (in Netlify CI environment).

@winniehell
Copy link

This is a duplicate of GitbookIO/gitbook-cli#68 and seems to be rather a gitbook-cli issue to me.

dnlup pushed a commit to eca-automs/mcpx-board-manual-p_it that referenced this issue Jul 14, 2017
This error is due to an issue with the new released version 2.3.1 of
gitbook-cli (GitbookIO/gitbook-cli#68 and
GitbookIO/gitbook#1818)
@AaronO
Copy link

AaronO commented Jul 14, 2017

This should now be fixed by the gitbook-cli @ 2.3.2 release and is a duplicate of GitbookIO/gitbook-cli#68

@AaronO AaronO closed this as completed Jul 14, 2017
@AaronO AaronO marked this as a duplicate of GitbookIO/gitbook-cli#68 Jul 14, 2017
@winniehell
Copy link

winniehell commented Jul 14, 2017

Thank you @AaronO! ❤️ I can confirm this is fixed in gitbook-cli 2.3.2. ✨

@adiferd
Copy link

adiferd commented Jul 16, 2017

Thank you @AaronO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants