最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【未解决】gitbook install安装插件速度极其慢

gitbook crifan 7007浏览 0评论

折腾:

【已解决】Gitbook页面底部加google adsense广告

期间,遇到之前就遇到的:

gitbook install

去安装插件时,速度极其的慢:

安装10多个插件,要好几十分钟。

而此处已经用ss的全局翻墙了。速度依旧很慢。

看到log中有写:

gitbook install
info: installing 18 plugins using [email protected] 
info:  
info: installing plugin

-》

petehouston/gitbook-plugin-google-adsense: Inject Google Adsense to your Gitbook.

好像直接换用npm去安装试试是否可行

npm install gitbook-plugin-google-adsense

结果:

npm install gitbook-plugin-google-adsense
<p>npm WARN checkPermissions Missing write access to /Users/crifan/dev/dev_root/gitbook/gitbook_src_root/books/gitbook_demo/node_modules/node_modules</p><p>npm WARN enoent ENOENT: no such file or directory, open '/Users/crifan/dev/dev_root/gitbook/gitbook_src_root/books/gitbook_demo/package.json'</p>

还是算了。

路径就不对,多出了个node_modules

gitbook install slow

使用 gitbook 托管多个项目文档 – XuSheng’s Blog

使用npm安装一些包失败了的看过来(npm国内镜像介绍) – CNode技术社区

感觉问题其实就是:

npm安装很慢

或许给npm加了此处代理,速度就好了?

npm install slow

npm install 太慢

node.js – Why is “npm install” really slow? – Stack Overflow

解决国内NPM安装依赖速度慢问题 – 简书

npm config get
; cli configs
metrics-registry = "https://registry.npm.taobao.org/"
scope = ""
user-agent = "npm/6.1.0 node/v10.4.0 darwin x64"

; userconfig /Users/crifan/.npmrc

registry = “https://registry.npm.taobao.org/”

; node bin location = /Users/crifan/.nvm/versions/node/v10.4.0/bin/node

; cwd = /Users/crifan/dev/dev_root/gitbook/gitbook_src_root/books/gitbook_demo

; HOME = /Users/crifan

; “npm config ls -l” to show all defaults.

registry已经是淘宝了。

NPM 国内慢的问题解决 – 掘金

gitbook install too slow

mac gitbook install  slow

还是无法解决。

不过后来想到一个规避的办法:

安装的过程,是依据plugins中的列表的顺序进行的:

为了尽快安装新加入的插件,可以考虑吧插件,从末尾放到开始:

这样第一个就安装新增插件,

安装后,即可中断安装过程

而不会对其他已有插件产生影响。

【后记】

后来发现貌似不行,所以只能再重新等足够长时间,等所有插件安装完毕。

具体过程详见:

【已解决】gitbook中安装Google Adsense插件:gitbook-plugin-google-adsense

转载请注明:在路上 » 【未解决】gitbook install安装插件速度极其慢

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
89 queries in 0.169 seconds, using 22.14MB memory