Comments (6)
你打开文件 D:\hexo\blog\node_modules\hexo-auto-category\lib\logic.js
加一行代码测试看看呢?
// 3.2 prevents duplicate file changes
log.i(tmpPost.categories); // 添加这一行,打印看看
if (tmpPost.categories && (tmpPost.categories.join("_") == newCategories.join("_"))) return data;
tmpPost.categories = newCategories
from hexo-auto-category.
除了之前的报错,还打印出了我的一些博文的文件夹信息.我是每个文件夹下有一些博文,为啥有的文件夹打印好多次?
$ hexo g INFO Start processing INFO [ 'computer_network' ] INFO hexo INFO [ 'php' ] INFO [ 'sql_injection' ] INFO [ 'sql_injection' ] INFO [ 'sql_injection' ] INFO [ 'sql_injection' ] INFO [ 'sql_injection' ] INFO [ 'sql_injection' ] INFO [ 'sql_injection' ] INFO [ 'sql_injection' ] INFO [ 'sql_injection' ] INFO [ 'sql_injection' ] INFO [ 'sql_injection' ] INFO [ 'sql_injection' ] INFO [ 'sql_injection' ] INFO [ 'wireshark' ] INFO [ 'wireshark' ] INFO [ 'computer_network' ] INFO [ 'php' ] INFO [ 'php' ] INFO [ 'sql_injection' ] INFO [ 'sql_injection' ] INFO [ 'sql_injection' ] INFO [ 'wireshark' ] INFO [ 'wireshark' ] INFO [ 'xss' ] INFO [ 'xss' ] INFO [ 'wireshark' ] INFO [ 'wireshark' ] INFO [ 'xss' ] INFO [ 'sql_injection' ] INFO [ 'xss' ] INFO [ 'wireshark' ] INFO [ 'sql_injection' ] INFO [ 'file upload' ] FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html TypeError: tmpPost.categories.join is not a function at Hexo.logic (D:\hexo\blog\node_modules\hexo-auto-category\lib\logic.js:34:55) at Hexo.tryCatcher (D:\hexo\blog\node_modules\bluebird\js\release\util.js:16:23) at Hexo.<anonymous> (D:\hexo\blog\node_modules\bluebird\js\release\method.js:15:34) at Promise.each.filter (D:\hexo\blog\node_modules\hexo\lib\extend\filter.js:60:50) at tryCatcher (D:\hexo\blog\node_modules\bluebird\js\release\util.js:16:23) at Object.gotValue (D:\hexo\blog\node_modules\bluebird\js\release\reduce.js:155:18) at Object.gotAccum (D:\hexo\blog\node_modules\bluebird\js\release\reduce.js:144:25) at Object.tryCatcher (D:\hexo\blog\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (D:\hexo\blog\node_modules\bluebird\js\release\promise.js:517:31) at Promise._settlePromise (D:\hexo\blog\node_modules\bluebird\js\release\promise.js:574:18) at Promise._settlePromise0 (D:\hexo\blog\node_modules\bluebird\js\release\promise.js:619:10) at Promise._settlePromises (D:\hexo\blog\node_modules\bluebird\js\release\promise.js:699:18) at _drainQueueStep (D:\hexo\blog\node_modules\bluebird\js\release\async.js:138:12) at _drainQueue (D:\hexo\blog\node_modules\bluebird\js\release\async.js:131:9) at Async._drainQueues (D:\hexo\blog\node_modules\bluebird\js\release\async.js:147:5) at Immediate.Async.drainQueues [as _onImmediate] (D:\hexo\blog\node_modules\bluebird\js\release\async.js:17:14) at runCallback (timers.js:705:18) at tryOnImmediate (timers.js:676:5) at processImmediate (timers.js:658:5)
from hexo-auto-category.
看不出来什么原因,再打印一下 type呢?
log.i(typeof(tmpPost.categories));
log.i(tmpPost.categories);
from hexo-auto-category.
嗯,打印之后是:
$ hexo g INFO Start processing INFO object INFO [ 'computer_network' ] INFO string INFO hexo INFO object INFO [ 'php' ] INFO object INFO [ 'sql_injection' ] INFO object INFO [ 'sql_injection' ] INFO object INFO [ 'sql_injection' ] INFO object INFO [ 'sql_injection' ] INFO object INFO [ 'sql_injection' ] INFO object INFO [ 'sql_injection' ] INFO object INFO [ 'sql_injection' ] INFO object INFO [ 'sql_injection' ] INFO object INFO [ 'sql_injection' ] INFO object INFO [ 'sql_injection' ] INFO object INFO [ 'sql_injection' ] INFO object INFO [ 'sql_injection' ] INFO object INFO [ 'sql_injection' ] INFO object INFO [ 'wireshark' ] INFO object INFO [ 'wireshark' ] INFO object INFO [ 'computer_network' ] INFO object INFO [ 'php' ] INFO object INFO [ 'php' ] INFO object INFO [ 'sql_injection' ] INFO object INFO [ 'sql_injection' ] INFO object INFO [ 'sql_injection' ] INFO object INFO [ 'wireshark' ] INFO object INFO [ 'wireshark' ] INFO object INFO [ 'xss' ] INFO object INFO [ 'xss' ] INFO object INFO [ 'wireshark' ] INFO object INFO [ 'wireshark' ] INFO object INFO [ 'xss' ] INFO object INFO [ 'sql_injection' ] INFO object INFO [ 'xss' ] INFO object INFO [ 'wireshark' ] INFO object INFO [ 'sql_injection' ] INFO object
from hexo-auto-category.
是不是因为出现了一个string类型
INFO string INFO hexo
哪来的呢,
from hexo-auto-category.
谢谢大神, 成功解决. 我把对应那个 hexo 文件夹下的博文的原来自己写的 categories 删除掉,就好了耶. 我看好像是我那里的 categories 格式不太对, 所以报错了. 谢谢
from hexo-auto-category.
Related Issues (20)
- How do I create files in subdirectories? HOT 4
- _Post.md 可以指定生成分类目录需要几层吗? HOT 1
- 如果能在hexo new 的时候源文件也能归档就好了
- 在应用该插件的工程中遇到了tmppPost.categories不是个函数这个问题。 HOT 1
- 文章标题解析不成功 HOT 2
- join is not a function HOT 11
- 这个问题请看一下,装了这个hexo-auto-category插件,clean了之后 hexo g的时候就会报错,卸载这个插件之后就没事 HOT 3
- 这真是一个很好👍插件,有问题请教下,不甚感激! HOT 5
- 您好,npm是否可以重新发布一下 HOT 3
- 存在以下问题:INFO Generated: categories [null] for post HOT 13
- 希望能添加一个自动根据文件标题添加title的功能? HOT 3
- 重命名文件夹文章内容丢失 HOT 3
- 在已经有文章的文件夹改名字会清除原来的文章 HOT 1
- 编译时 categories 分类内容会被清空 HOT 1
- 通过Github Action自动部署时没有起作用 HOT 2
- 求助:希望博客链接不带有分类层级
- 能否检测_config.yml中的category_map,将生成的英文category缩略名转化为它对应的中文分类全名?
- 关于categories为空的问题
- 文件夹更名后文章内容被清空
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hexo-auto-category.