gitbook:gitbook-cli\node_modules\npm\node_modules\graceful-fs\polyfills.js
2021/7/21 17:11:34
本文主要是介绍gitbook:gitbook-cli\node_modules\npm\node_modules\graceful-fs\polyfills.js,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
gitbook:gitbook-cli\node_modules\npm\node_modules\graceful-fs\polyfills.js
1.异常
执行gitbook init报错:
C:\Users\EB\AppData\Roaming\npm\node_modules\gitbook-cli\node_modules\npm\node_modules\graceful-fs\polyfills.js:287 if (cb) cb.apply(this, arguments) ^
执行gitbook init过程:
EB@DESKTOP-K45IA6V MINGW64 ~/Desktop $ mkdir test1280-gitbook EB@DESKTOP-K45IA6V MINGW64 ~/Desktop $ cd test1280-gitbook/ EB@DESKTOP-K45IA6V MINGW64 ~/Desktop/test1280-gitbook $ gitbook init Installing GitBook 3.2.3 C:\Users\EB\AppData\Roaming\npm\node_modules\gitbook-cli\node_modules\npm\node_modules\graceful-fs\polyfills.js:287 if (cb) cb.apply(this, arguments) ^ TypeError: cb.apply is not a function at C:\Users\EB\AppData\Roaming\npm\node_modules\gitbook-cli\node_modules\npm\node_modules\graceful-fs\polyfills.js:287:18 at FSReqCallback.oncomplete (fs.js:193:5)
2.环境
node version
EB@DESKTOP-K45IA6V MINGW64 ~/Desktop/test1280-gitbook $ node -v v14.17.3
npm version
EB@DESKTOP-K45IA6V MINGW64 ~/Desktop/test1280-gitbook $ npm -v 6.14.13
3.解决
卸载当前高版本的nodejs,安装低版本的nodejs。
nodejs历史版本下载:https://nodejs.org/dist/
我选择的是node-v12.22.3-x64.msi:
https://nodejs.org/dist/latest-v12.x/node-v12.22.3-x64.msi
重新安装nodejs。
重试:
EB@DESKTOP-K45IA6V MINGW64 ~/Desktop/test1280-gitbook $ node -v v12.22.3 EB@DESKTOP-K45IA6V MINGW64 ~/Desktop/test1280-gitbook $ npm -v 6.14.13 EB@DESKTOP-K45IA6V MINGW64 ~/Desktop/test1280-gitbook $ npm install -g gitbook-cli C:\Users\EB\AppData\Roaming\npm\gitbook -> C:\Users\EB\AppData\Roaming\npm\node_modules\gitbook-cli\bin\gitbook.js + gitbook-cli@2.3.2 updated 3 packages in 10.212s EB@DESKTOP-K45IA6V MINGW64 ~/Desktop/test1280-gitbook $ gitbook init warn: no summary file in this book info: create README.md info: create SUMMARY.md info: initialization is finished EB@DESKTOP-K45IA6V MINGW64 ~/Desktop/test1280-gitbook $ ll total 2 -rw-r--r-- 1 EB 197609 16 7月 21 14:45 README.md -rw-r--r-- 1 EB 197609 40 7月 21 14:45 SUMMARY.md
gitbook init成功。
4.其他
如果遇到报错:
TypeError [ERR_INVALID_ARG_TYPE]: The “data” argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Promise
EB@DESKTOP-K45IA6V MINGW64 ~/Desktop/test1280-gitbook $ gitbook init warn: no summary file in this book info: create README.md info: create SUMMARY.md TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Promise EB@DESKTOP-K45IA6V MINGW64 ~/Desktop/test1280-gitbook $ ll total 1 -rw-r--r-- 1 EB 197609 16 7月 21 14:37 README.md
同上,卸载高版本的nodejs,安装低版本的nodejs,重试。
5.参考
1.https://blog.csdn.net/Java_stud/article/details/118493661
2.https://blog.csdn.net/withoutBugs/article/details/105869042
3.https://stackoverflow.com/questions/64211386/gitbook-cli-install-error-typeerror-cb-apply-is-not-a-function-inside-graceful
4.https://blog.csdn.net/Ming_360/article/details/109685876
5.https://lgl88911.gitee.io/2020/11/08/Windows%E4%B8%8BGitbook%E5%AE%89%E8%A3%85/
6.https://nodejs.org/en/download/
这篇关于gitbook:gitbook-cli\node_modules\npm\node_modules\graceful-fs\polyfills.js的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-24Vue CLI多环境配置学习:从入门到实践
- 2024-11-24Vue CLI多环境配置学习:新手入门教程
- 2024-11-24Vue CLI学习:初学者指南
- 2024-11-24Vue CLI学习:从入门到上手的简单教程
- 2024-11-24Vue3+Vite学习:从零开始的前端开发之旅
- 2024-11-24Vue3阿里系UI组件学习入门教程
- 2024-11-24Vue3的阿里系UI组件学习入门指南
- 2024-11-24Vue3公共组件学习:新手入门教程
- 2024-11-24Vue3公共组件学习入门指南
- 2024-11-24vue3核心功能响应式变量学习