Rgitbook
Rgitbook copied to clipboard
On Windows: running command 'npm' had status 1
I am getting the following error for checkGitbook(), gitbookInfo() and newGitbook("testbook") although I do have node.js installed, had no trouble installing gitbook (via R or node bash) and the node_modules folder was created in my project directory. Unlike janeshdev, restarting Windows did not help.
> newGitbook("testbook")
Usage: npm <command>
where <command> is one of:
add-user, adduser, apihelp, author, bin, bugs, c, cache,
completion, config, ddp, dedupe, deprecate, docs, edit,
explore, faq, find, find-dupes, get, help, help-search,
home, i, info, init, install, isntall, issues, la, link,
list, ll, ln, login, ls, outdated, owner, pack, prefix,
prune, publish, r, rb, rebuild, remove, repo, restart, rm,
root, run-script, s, se, search, set, show, shrinkwrap,
star, stars, start, stop, submodule, t, tag, test, tst, un,
uninstall, unlink, unpublish, unstar, up, update, v,
version, view, whoami
npm <cmd> -h quick help on <cmd>
npm -l display full usage info
npm faq commonly asked questions
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
C:\Users\Tanya\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
[email protected] C:\PROGRA~1\nodejs\node_modules\npm
Error in checkForGitbook(quiet = TRUE) :
Cannot find node.js. You can install it from http://nodejs.org/download/
In addition: Warning message:
running command 'npm' had status 1
I have the same problem. Using Win 7 64x, rstudio 0.98.507, r 3.1.0
> newGitbook("GitBook")
Usage: npm <command>
where <command> is one of:
add-user, adduser, apihelp, author, bin, bugs, c, cache,
completion, config, ddp, dedupe, deprecate, docs, edit,
explore, faq, find, find-dupes, get, help, help-search,
home, i, info, init, install, isntall, issues, la, link,
list, ll, ln, login, ls, outdated, owner, pack, prefix,
prune, publish, r, rb, rebuild, remove, repo, restart, rm,
root, run-script, s, se, search, set, show, shrinkwrap,
star, stars, start, stop, submodule, t, tag, test, tst, un,
uninstall, unlink, unpublish, unstar, up, update, v,
version, view, whoami
npm <cmd> -h quick help on <cmd>
npm -l display full usage info
npm faq commonly asked questions
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
C:\Users\Delta\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
[email protected] C:\PROGRA~2\nodejs\node_modules\npm
Error in checkForGitbook(quiet = TRUE) :
Cannot find node.js. You can install it from http://nodejs.org/download/
In addition: Warning message:
running command 'npm' had status 1
I have found the same problem and I have submitted this Pull Request #22 that fixes this issue for me.
If you wish, for now, you can download my fixes using:
devtools::install_github("raulossada/Rgitbook");
require(Rgitbook);
# Install gitbook-plugin globally instead of locally
system("npm install gitbook-plugin -g");
Also, I had to manually download and install in the appropriate place the phantomjs-1.9.7-windows.zip from: http://phantomjs.org/download.html
# Check if npm and the gitbook module is installed on your machine
checkForGitbook();
# Check if the lastest version of the gitbook module is installed on your machine
gitbookInfo();
# Create a test book
newGitbook("testbook");
# Initialize your test book
initGitbook();
# Build your *.Rmd files into *.md files
buildGitbook();
# Open your test book on a web browser
openGitbook();
Hope this help you.
Thanks @raulossada that's work for me.