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

2017-09-09 17:53:46 +08:00
 thomaswang

> 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! hexo-util@0.6.1 postinstall: `npm run build:highlight`
npm ERR! Exit status 243
npm ERR! 
npm ERR! Failed at the hexo-util@0.6.1 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

4375 次点击
所在节点    问与答
8 条回复
grimpil
2017-09-09 18:48:06 +08:00
方框里说得很清楚了吧
Phariel
2017-09-09 18:52:14 +08:00
权限不够
thomaswang
2017-09-09 22:05:08 +08:00
@Phariel 那该怎么做呢
thomaswang
2017-09-09 22:05:32 +08:00
@grimpil 挺清楚的 该怎么解决呢
Trim21
2017-09-09 22:10:05 +08:00
sudo chown -R $USER:$(id -gn $USER) /var/root/.config
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
2017-09-22 14:30:04 +08:00
npm config set user 0
npm config set unsafe-perm true
bentoule
2017-10-16 23:36:47 +08:00
@danhoo 谢谢,这个方法可行

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

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

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

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

© 2021 V2EX