当前位置: 首页 > 工具软件 > hexo-douban > 使用案例 >

使用hexo+gitee搭建博客时踩的小坑(Plugin load failed: %s hexo-tag-bootstrap)

吕琪
2023-12-01

详细配置步骤网上已经有了很多教程,我在这里就不赘述了。

以下贴出我遇到的一个小坑吧。

这个问题是和hexo的插件hexo-tag-bootstrap有关,具体错误如下:

C:\Users\Administrator\blog                                                                                                    
λ hexo.cmd g                                                                                                            
INFO  Validating config                                                                                                 
ERROR {                                                                                                                 
  err: C:\Users\Administrator\blog\node_modules\hexo-tag-bootstrap\input.js:8                                                  
  <div class="form-group">                                                                                              
  ^                                                                                                                     
                                                                                                                        
  SyntaxError: Unexpected token '<'                                                                                     
      at wrapSafe (internal/modules/cjs/loader.js:979:16)                                                               
      at Module._compile (internal/modules/cjs/loader.js:1027:27)                                                       
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)                                         
      at Module.load (internal/modules/cjs/loader.js:928:32)                                                            
      at Function.Module._load (internal/modules/cjs/loader.js:769:14)                                                  
      at Module.require (internal/modules/cjs/loader.js:952:19)                                                         
      at require (C:\Users\Administrator\blog\node_modules\hexo\lib\hexo\index.js:292:23)                                      
      at C:\Users\Administrator\blog\node_modules\hexo-tag-bootstrap\index.js:14:23                                            
      at C:\Users\Administrator\blog\node_modules\hexo\lib\hexo\index.js:305:14                                                
      at tryCatcher (C:\Users\Administrator\blog\node_modules\bluebird\js\release\util.js:16:23)                               
      at Promise._settlePromiseFromHandler (C:\Users\Administrator\blog\node_modules\bluebird\js\release\promise.js:547:31)    
      at Promise._settlePromise (C:\Users\Administrator\blog\node_modules\bluebird\js\release\promise.js:604:18)               
      at Promise._settlePromise0 (C:\Users\Administrator\blog\node_modules\bluebird\js\release\promise.js:649:10)              
      at Promise._settlePromises (C:\Users\Administrator\blog\node_modules\bluebird\js\release\promise.js:729:18)              
      at _drainQueueStep (C:\Users\Administrator\blog\node_modules\bluebird\js\release\async.js:93:12)                         
      at _drainQueue (C:\Users\Administrator\blog\node_modules\bluebird\js\release\async.js:86:9)                              
      at Async._drainQueues (C:\Users\Administrator\blog\node_modules\bluebird\js\release\async.js:102:5)                      
      at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\Administrator\blog\node_modules\bluebird\js\release\async.js:1
5:14)                                                                                                                   
      at processImmediate (internal/timers.js:461:21)                                                                   
} Plugin load failed: %s hexo-tag-bootstrap                                                                             
INFO  Start processing                                                                                                  
INFO  Files loaded in 122 ms                                                                                            
INFO  0 files generated in 21 ms                                                                                        
                                                                                                                        

在这里爆出了Plugin load failed: %s hexo-tag-bootstrap的错误,经过多方查证之后,在https://github.com/wzpan/hexo-tag-bootstrap/issues/8#issuecomment-353982346找到解决方法,原来是开发者还没适配这个问题,需要把bootstrap降级到适配版本即可:

首先,卸载掉当前版本:

npm uninstall hexo-tag-bootstrap

其次,安装指定版本:

npm install --save hexo-tag-bootstrap@0.0.8

OK,重新执行以下hexo g命令:

C:\Users\Administrator\blog
λ hexo.cmd g
INFO  Validating config
INFO  Start processing
INFO  Files loaded in 136 ms
INFO  0 files generated in 26 ms

问题解决。

 类似资料: