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

Gitbook install/init fails #74

Closed
jbaskeen opened this issue Oct 19, 2017 · 7 comments
Closed

Gitbook install/init fails #74

jbaskeen opened this issue Oct 19, 2017 · 7 comments

Comments

@jbaskeen
Copy link

I'm trying to install and use gitbook-cli for the first time and am seeing an issue getting it running. I've seen #68 issue but the solutions in the issue don't appear to work for me. I'm not finding any node/npm compatibility details in the docs so I'm not sure if the latest node 8 is supported. However, I'm also seeing the issues with node 6.

Commands:

node -v
npm -v
rm -rf ~/.gitbook
npm i -g gitbook-cli
gitbook --version
gitbook init

Output:

node v8.7.0
npm 5.4.2
/usr/local/bin/gitbook -> /usr/local/lib/node_modules/gitbook-cli/bin/gitbook.js
+ [email protected]
added 578 packages in 8.667s
CLI version: 2.3.2
Installing GitBook 3.2.3
undefined ../../../../../var/folders/mc/22vf5c6d69ncltcmpd7vkx8w0000gn/T/tmp-90812CaAhzXdEJqUm/node_modules/gitbook
├── [email protected]
├── undefined
├── undefined
├── undefined
├── undefined
├── undefined
├── [email protected]
├── undefined
├── undefined
├── undefined
├── undefined
├── undefined
├── [email protected]
├── undefined
├── undefined
├── undefined
├── [email protected]
├── undefined
├── undefined
├── undefined
├── undefined
├── undefined
├── undefined
├── [email protected]
├── undefined
├── [email protected]
├── undefined ([email protected], [email protected])
├── undefined ([email protected], [email protected])
├── [email protected] ([email protected], )
├── undefined ([email protected])
├── undefined ([email protected])
├── undefined ([email protected], [email protected], [email protected], , , [email protected], [email protected], , [email protected], [email protected])
├── undefined
├── undefined
├── undefined
├── undefined (, , [email protected], [email protected], [email protected], [email protected], [email protected])
├── undefined ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── undefined ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── undefined
├── undefined (, )
├── undefined
├── undefined
├── undefined ([email protected])
├── undefined ([email protected], , , , , [email protected], )
├── undefined ([email protected])
├── undefined ([email protected], [email protected], [email protected], [email protected], [email protected])
├── undefined (, [email protected], , [email protected])
├── undefined ([email protected], , [email protected])
├── undefined ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── undefined ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── undefined ([email protected], [email protected], [email protected])
└── undefined
GitBook version: 3.2.3
�[0;31mError loading version latest: Error: Cannot find module '/Users/James/.gitbook/versions/3.2.3'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:476:23)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at /usr/local/lib/node_modules/gitbook-cli/lib/local.js:103:23
    at _fulfilled (/usr/local/lib/node_modules/gitbook-cli/node_modules/q/q.js:854:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/gitbook-cli/node_modules/q/q.js:883:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/gitbook-cli/node_modules/q/q.js:816:13)
    at /usr/local/lib/node_modules/gitbook-cli/node_modules/q/q.js:877:14
    at runSingle (/usr/local/lib/node_modules/gitbook-cli/node_modules/q/q.js:137:13)�[0m

�[0;31mTypeError: Cannot read property 'commands' of null�[0m
@jbaskeen
Copy link
Author

jbaskeen commented Dec 9, 2017

@werne2j discovered that the following steps worked

npm install -g [email protected]

cd /usr/local/lib/node_modules/gitbook-cli
rm -rf node_modules
sed -i '' "s^[email protected]^[email protected]^g" package.json
npm install

cd ~

gitbook fetch 3.2.2
cd ~/.gitbook/versions/3.2.2/
rm -rf node_modules
npm install

cd ~

mkdir test && cd test
gitbook init

@svobodaa
Copy link

Thanks this worked for me as I was also having an issue with file not found errors during the install of 3.2.2. However I did not need to rm -rf ~/.gitbook/versions/3.2.2/node_modules as it wasn't there.

@jbaskeen THANKS!

@smiled0g
Copy link

Doesn't work at all on Windows.

@jLouzado
Copy link

Is it possible it's failing cuz of nvm? I've tried everything, doesn't seem to be working

@Louis-XIV
Copy link

Doesn't work at all on Windows.

cd ~/.gitbook/version/3.2.3
npm install

it works

@terrylinooo
Copy link

cd ~/.gitbook/version/3.2.3

I do confirm this works, but the path should be:

cd ~/.gitbook/versions/3.2.3

@minhnguyenvan95
Copy link

@werne2j discovered that the following steps worked

npm install -g [email protected]

cd /usr/local/lib/node_modules/gitbook-cli
rm -rf node_modules
sed -i '' "s^[email protected]^[email protected]^g" package.json
npm install

cd ~

gitbook fetch 3.2.2
cd ~/.gitbook/versions/3.2.2/
rm -rf node_modules
npm install

cd ~

mkdir test && cd test
gitbook init

this save me

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

7 participants