安装 hexo npm 报错 是什么原因?求助

2018-12-27 16:45:18 +08:00
 getElementsbyId

$ npm install -g hexo
npm WARN deprecated titlecase@1.1.2: no longer maintained
npm WARN deprecated postinstall-build@5.0.3: postinstall-build's behavior is now built into npm! You should migrate off of postinstall-build and use the new prepare lifecycle script with npm 5.0.0 or greater.
npm ERR! Unexpected end of JSON input while parsing near '...2.1","nyc":"^3.0.0","'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2018-12-27T08_34_53_110Z-debug.log

4939 次点击
所在节点    Node.js
6 条回复
getElementsbyId
2018-12-27 16:46:19 +08:00
百度了一下 有说是 npm 源的问题 已经更换为 taobao 源 但是还是报这个错
Twinkle
2018-12-27 16:50:08 +08:00
npm i -g hexo-cli

用新版,你装的是老的
jera
2018-12-27 16:53:02 +08:00
看报错应该是 package.json 语法错误
Dictator
2018-12-27 16:58:08 +08:00
package.json 有问题吧
getElementsbyId
2018-12-27 16:58:36 +08:00
@Twinkle 确实是的 已经解决 谢谢 Thanks♪(・ω・)ノ
getElementsbyId
2018-12-27 17:08:21 +08:00
@Twinkle 然后我 init 的时候 他把项目 clone 到我本地了 但还是继续报错 还是 npm WARN 不推荐使用 titlecase@1.1.2:不再维护<br>
npm WARN 不推荐使用 postinstall-build@5.0.3:
npm WARN deprecated titlecase@1.1.2: no longer maintained<br>
npm WARN deprecated postinstall-build@5.0.3: postinstall-build's behavior is now built into npm! You should migrate off of postinstall-build and use the new `prepare` lifecycle script with npm 5.0.0 or greater.
npm ERR! Unexpected end of JSON input while parsing near '...2.1","nyc":"^3.0.0","'<br>

npm ERR! A complete log of this run can be found in:<br>
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2018-12-27T09_03_53_885Z-debug.log<br>
WARN Failed to install dependencies. Please run 'npm install' manually!<br>

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/521583

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX