V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
thomaswang
V2EX  ›  问与答

hexo 实在搞不懂,一直报这个

  •  
  •   thomaswang · 2017-09-09 17:53:46 +08:00 · 4370 次点击
    这是一个创建于 2421 天前的主题,其中的信息可能已经有所发展或是发生改变。
    
    > node scripts/build_highlight_alias.js > highlight_alias.json
    
    npm ERR! Callback called more than once.
    
    ┌───────────────────────────────────────────────────────┐
    │                npm update check failed                │
    │          Try running with sudo or get access          │
    │         to the local update config store via          │
    │ sudo chown -R $USER:$(id -gn $USER) /var/root/.config │
    └───────────────────────────────────────────────────────┘
    npm ERR! code ELIFECYCLE
    npm ERR! errno 243
    npm ERR! [email protected] postinstall: `npm run build:highlight`
    npm ERR! Exit status 243
    npm ERR! 
    npm ERR! Failed at the [email protected] postinstall script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /var/root/.npm/_logs/2017-09-09T09_48_52_309Z-debug.log
    
    
    8 条回复    2017-10-16 23:36:47 +08:00
    grimpil
        1
    grimpil  
       2017-09-09 18:48:06 +08:00 via Android
    方框里说得很清楚了吧
    Phariel
        2
    Phariel  
       2017-09-09 18:52:14 +08:00 via Android
    权限不够
    thomaswang
        3
    thomaswang  
    OP
       2017-09-09 22:05:08 +08:00 via iPhone
    @Phariel 那该怎么做呢
    thomaswang
        4
    thomaswang  
    OP
       2017-09-09 22:05:32 +08:00 via iPhone
    @grimpil 挺清楚的 该怎么解决呢
    Trim21
        5
    Trim21  
       2017-09-09 22:10:05 +08:00
    sudo chown -R $USER:$(id -gn $USER) /var/root/.config
    levinit
        6
    levinit  
       2017-09-14 23:20:22 +08:00
    >Workaround 1 (safer)

    $ sudo chown -R user /usr/lib/node_modules
    $ npm i -g hexo-cli as user
    $ sudo chown -R root /usr/lib/node_modules

    >Workaround 2 (less safe)

    # npm config set user 0
    # npm config set unsafe-perm true (unsafe-perm)
    # npm install -g hexo

    如果你使用 archlinux 或者基于 arch 的发行版,你可以使用 yaourt -S nodejs-hexo-cli
    danhoo
        7
    danhoo  
       2017-09-22 14:30:04 +08:00
    npm config set user 0
    npm config set unsafe-perm true
    bentoule
        8
    bentoule  
       2017-10-16 23:36:47 +08:00
    @danhoo 谢谢,这个方法可行
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2681 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 02:16 · PVG 10:16 · LAX 19:16 · JFK 22:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.