hexo g 正常
hexo 失败
hexo init demo && cd demogit clone https://github.com/iissnan/hexo-theme-next themes/nextUnhandled rejection TypeError: path.substring is not a function
at Object.urlForHelper (/Users/jingwenzheng/Desktop/demo/node_modules/hexo/lib/plugins/helper/url_for.js:9:31)
at wrapper (/Users/jingwenzheng/Desktop/demo/node_modules/lodash/lodash.js:4968:19)
at Object.eval [as tpl] (eval at <anonymous> (/Users/jingwenzheng/Desktop/demo/node_modules/swig/lib/swig.js:498:13), <anonymous>:125:119)
at compiled (/Users/jingwenzheng/Desktop/demo/node_modules/swig/lib/swig.js:619:18)
at Object.eval [as tpl] (eval at <anonymous> (/Users/jingwenzheng/Desktop/demo/node_modules/swig/lib/swig.js:498:13), <anonymous>:807:135)
at compiled (/Users/jingwenzheng/Desktop/demo/node_modules/swig/lib/swig.js:619:18)
at _compiled (/Users/jingwenzheng/Desktop/demo/node_modules/hexo/lib/theme/view.js:127:30)
at View.render (/Users/jingwenzheng/Desktop/demo/node_modules/hexo/lib/theme/view.js:29:15)
at /Users/jingwenzheng/Desktop/demo/node_modules/hexo/lib/hexo/index.js:390:25
at tryCatcher (/Users/jingwenzheng/Desktop/demo/node_modules/bluebird/js/release/util.js:16:23)
at /Users/jingwenzheng/Desktop/demo/node_modules/bluebird/js/release/method.js:15:34
at RouteStream._read (/Users/jingwenzheng/Desktop/demo/node_modules/hexo/lib/hexo/router.js:134:3)
at RouteStream.Readable.read (_stream_readable.js:336:10)
at resume_ (_stream_readable.js:726:12)
at _combinedTickCallback (node.js:377:13)
at process._tickCallback (node.js:401:11)
hexo: 3.3.9
hexo-cli: 1.0.1
os: Darwin 16.7.0 darwin x64
http_parser: 2.6.2
node: 5.8.0
v8: 4.6.85.31
uv: 1.8.0
zlib: 1.2.8
ares: 1.10.1-DEV
icu: 56.1
modules: 47
openssl: 1.0.2g
当前的 hexo-theme-next 版本 v5.1.3
NexT Version:
NexT Scheme:
调试发现问题出在
````
try
{
if (path[0] === '#' || path.substring(0, 2) === '//') {
return path;
}
}
catch (e)
{
console.log(typeof path);
console.log(path.constructor.name);
console.log(path);
console.log(e.message);
console.log(e.description)
throw new Error(10,"asdasdasd")
}
````
本来 Path 应该为字符串的但是却出现了
Function
function
function small() { [native code] }
path.substring is not a function
TypeError
???
Try to check latest master branch. Issue still exists?
"before_script": [
"git config --global user.name \"aimobier\"",
"git config --global user.email \"[email protected]\"",
"sed -i'' \"[email protected]:${UName}/${PName}.git~https://${github}:[email protected]/${UName}/${PName}.git~\" _config.yml",
"git clone https://github.com/iissnan/hexo-theme-next themes/next",
"ls",
"pwd",
"cp -rf source/themes_config.yml themes/next/_config.yml",
"cp -rf source/404.html themes/next/source/404.html"
],
yes,issue still exists
Could you please provide the following information?
node -v && npm -v)?hexo -v)?cat package.json)?Please, try to reproduce this behavior with any default Hexo theme (light / landscape).
If behavior will same, it's not NexT theme bug; close this issue and create same issue in Hexo repositories: hexo-renderer-marked or hexo root engine will at most best choises.
I have also met this issue, if I change the theme to other theme, hexo s -g runs fine, but if I use theme NexT, error messages occur
If I completely delete next directory in my local machine and git clone the repo again, the error message will disappear. I do not know why.
@jdhao need mo info.
My reason is that I used the old version of thenext configuration file
Most helpful comment
My reason is that I used the old version of the
nextconfiguration file