Closed CodeWicky closed 7 years ago
用--save替换-save试试
我无法复现
我可以给出以下解决方案:
npm install npm@latest -g
更新 npm 版本可能是公司网络做了限制,回家试了一下可以了,感谢回复
不好意思,总问。。。 这次我安装成功了。 因为是刚开始弄博客,所以有些地方不太懂,您见谅哈。 因为不知道是在站点配置文件还是主题配置文件添加
live2d:
model: koharu
bottom: -360
所以我就都添加了。 然而并没有显示。 我使用的是NexT主体,我以为是底下的滚动条进度挡上就调到-360也显示不了。
但是
hexo g
的时候有明确的看到live2d的文件有集成进去。。。
不知道怎么弄呢。。。
因为 Next 主题使用了 swig 模板, 注入主题的代码应该改为
{% live2d() %}
请问Next主题应该把代码粘贴在哪个文件的什么位置啊?新手什么都不懂(ノへ ̄、)
@bigtnt 应该是这个文件 https://github.com/iissnan/hexo-theme-next/blob/master/layout/_layout.swig </body>
之前
@EYHN
@bigtnt 应该是这个文件 https://github.com/iissnan/hexo-theme- next/blob/master/layout/_layout.swig
之前
按照这个方式写入
{% live2d() %}
报出了这个错误. 我的主题也是next
ERROR Process failed: layout/page.swig Error: Unexpected tag "live2d()" on line 85 in file E:\blog\themes\next\layout_layout.swig. at Object.exports.throwError (E:\blog\node_modules\swig\lib\utils.js:183:9) at parseTag (E:\blog\node_modules\swig\lib\parser.js:544:13) at E:\blog\node_modules\swig\lib\parser.js:640:15 at Object.exports.each (E:\blog\node_modules\swig\lib\utils.js:45:11) at Object.exports.parse (E:\blog\node_modules\swig\lib\parser.js:624:9) at parse (E:\blog\node_modules\swig\lib\swig.js:354:19) at parseFile (E:\blog\node_modules\swig\lib\swig.js:380:17) at getParents (E:\blog\node_modules\swig\lib\swig.js:443:54) at Object.precompile (E:\blog\node_modules\swig\lib\swig.js:487:17) at Object.compile (E:\blog\node_modules\swig\lib\swig.js:606:16) at Function.swigRenderer.compile (E:\blog\node_modules\hexo\lib\plugins\renderer\swig.js:42:15) at View._precompile (E:\blog\node_modules\hexo\lib\theme\view.js:119:29) at View (E:\blog\node_modules\hexo\lib\theme\view.js:13:8) at new Theme._View.View (E:\blog\node_modules\hexo\lib\theme\index.js:37:10) at Theme.setView (E:\blog\node_modules\hexo\lib\theme\index.js:71:20) at E:\blog\node_modules\hexo\lib\theme\processors\view.js:14:14 at tryCatcher (E:\blog\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (E:\blog\node_modules\bluebird\js\release\promise.js:512:31) at Promise._settlePromise (E:\blog\node_modules\bluebird\js\release\promise.js:569:18) at Promise._settlePromise0 (E:\blog\node_modules\bluebird\js\release\promise.js:614:10) at Promise._settlePromises (E:\blog\node_modules\bluebird\js\release\promise.js:693:18) at Promise._fulfill (E:\blog\node_modules\bluebird\js\release\promise.js:638:18)
@Ailen1988 @bigtnt @CodeWicky 对不起之前搞错了。 特意下载了next主题试了一下,确实不行。swig
注入代码应该为
{{ live2d() }}
如图:
@EYHN @bigtnt @CodeWicky 有了!
谢谢 @EYHN 的帮助
npm WARN babel-eslint@10.0.2 requires a peer of eslint@>= 4.12.1 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN babel-eslint@10.0.2 requires a peer of eslint@>= 4.12.1 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
WARN不用管,不影响使用
Expected behavior (预期行为)
终端输入如下指令安装
Actual behavior (实际行为)
无法安装,报错
重现方式