Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

安装不了 #8

Closed
CodeWicky opened this issue Jun 8, 2017 · 12 comments
Closed

安装不了 #8

CodeWicky opened this issue Jun 8, 2017 · 12 comments

Comments

@CodeWicky
Copy link

Expected behavior (预期行为)

终端输入如下指令安装

npm install -save hexo-helper-live2d

Actual behavior (实际行为)

无法安装,报错

npm ERR! code EINTEGRITY
npm ERR! sha1-mYXGacUA8slGqQTvc3ir3dGgRMI= integrity checksum failed when using sha1: wanted sha1-mYXGacUA8slGqQTvc3ir3dGgRMI= but got sha1-rkEhFDik55a7FnyVkLLjyZZQIIQ=. (17877997 bytes)

重现方式

  • 1.打开至Blog根目录
  • 2.npm install -save hexo-helper-live2d
@bellchet58
Copy link

用--save替换-save试试

@EYHN
Copy link
Owner

EYHN commented Jun 9, 2017

我无法复现

我可以给出以下解决方案:

  • 在良好的网络环境下重试(国内可能需要代理)
  • 使用 cnpm
  • 把 npm registry 设置为默认
  • 运行 npm install npm@latest -g 更新 npm 版本
  • 重新安装 npm 和 node。截止目前最新版本为 npm 5.0.2 node 8.1.0.

@CodeWicky
Copy link
Author

可能是公司网络做了限制,回家试了一下可以了,感谢回复

@CodeWicky
Copy link
Author

不好意思,总问。。。
这次我安装成功了。
因为是刚开始弄博客,所以有些地方不太懂,您见谅哈。
因为不知道是在站点配置文件还是主题配置文件添加

live2d:
  model: koharu
  bottom: -360

所以我就都添加了。
然而并没有显示。
我使用的是NexT主体,我以为是底下的滚动条进度挡上就调到-360也显示不了。

但是

hexo g

的时候有明确的看到live2d的文件有集成进去。。。

不知道怎么弄呢。。。

@EYHN
Copy link
Owner

EYHN commented Jun 10, 2017

因为 Next 主题使用了 swig 模板, 注入主题的代码应该改为

{% live2d() %}

@ghost
Copy link

ghost commented Jun 12, 2017

请问Next主题应该把代码粘贴在哪个文件的什么位置啊?新手什么都不懂(ノへ ̄、)

@EYHN
Copy link
Owner

EYHN commented Jun 12, 2017

@bigtnt 应该是这个文件 https://github.com/iissnan/hexo-theme-next/blob/master/layout/_layout.swig </body> 之前

@Allen-LPL
Copy link

Allen-LPL commented Jun 13, 2017

@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)

@EYHN
Copy link
Owner

EYHN commented Jun 13, 2017

@Ailen1988 @bigtnt @CodeWicky 对不起之前搞错了。 特意下载了next主题试了一下,确实不行。swig注入代码应该为

{{ live2d() }}

如图:
image

@Allen-LPL
Copy link

@EYHN @bigtnt @CodeWicky
有了!

谢谢 @EYHN 的帮助

@ma-qing
Copy link

ma-qing commented Jul 14, 2019

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"})

@xiazeyu
Copy link
Collaborator

xiazeyu commented Jul 14, 2019

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不用管,不影响使用

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants