V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
getElementsbyId
V2EX  ›  Node.js

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

  •  
  •   getElementsbyId · 2018-12-27 16:45:18 +08:00 · 4754 次点击
    这是一个创建于 1940 天前的主题,其中的信息可能已经有所发展或是发生改变。

    $ npm install -g hexo
    npm WARN deprecated [email protected]: no longer maintained
    npm WARN deprecated [email protected]: 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

    6 条回复
    getElementsbyId
        1
    getElementsbyId  
    OP
       2018-12-27 16:46:19 +08:00
    百度了一下 有说是 npm 源的问题 已经更换为 taobao 源 但是还是报这个错
    Twinkle
        2
    Twinkle  
       2018-12-27 16:50:08 +08:00   ❤️ 1
    npm i -g hexo-cli

    用新版,你装的是老的
    jera
        3
    jera  
       2018-12-27 16:53:02 +08:00
    看报错应该是 package.json 语法错误
    Dictator
        4
    Dictator  
       2018-12-27 16:58:08 +08:00
    package.json 有问题吧
    getElementsbyId
        5
    getElementsbyId  
    OP
       2018-12-27 16:58:36 +08:00
    @Twinkle 确实是的 已经解决 谢谢 Thanks♪(・ω・)ノ
    getElementsbyId
        6
    getElementsbyId  
    OP
       2018-12-27 17:08:21 +08:00
    @Twinkle 然后我 init 的时候 他把项目 clone 到我本地了 但还是继续报错 还是 npm WARN 不推荐使用 [email protected]:不再维护<br>
    npm WARN 不推荐使用 [email protected]
    npm WARN deprecated [email protected]: no longer maintained<br>
    npm WARN deprecated [email protected]: 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>
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2818 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 13:26 · PVG 21:26 · LAX 06:26 · JFK 09:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.