getElementsbyId
V2EX  ›  Node.js

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

  •  
  •   getElementsbyId · Dec 27, 2018 · 5834 views
    This topic created in 2698 days ago, the information mentioned may be changed or developed.

    $ 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

    getElementsbyId
        1
    getElementsbyId  
    OP
       Dec 27, 2018
    百度了一下 有说是 npm 源的问题 已经更换为 taobao 源 但是还是报这个错
    Twinkle
        2
    Twinkle  
       Dec 27, 2018   ❤️ 1
    npm i -g hexo-cli

    用新版,你装的是老的
    jera
        3
    jera  
       Dec 27, 2018
    看报错应该是 package.json 语法错误
    Dictator
        4
    Dictator  
       Dec 27, 2018
    package.json 有问题吧
    getElementsbyId
        5
    getElementsbyId  
    OP
       Dec 27, 2018
    @Twinkle 确实是的 已经解决 谢谢 Thanks♪(・ω・)ノ
    getElementsbyId
        6
    getElementsbyId  
    OP
       Dec 27, 2018
    @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>
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4263 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 05:26 · PVG 13:26 · LAX 22:26 · JFK 01:26
    ♥ Do have faith in what you're doing.