Hexo安裝報錯 怎麼破
> [email protected] build:highlight /usr/lib/node_modules/hexo-cli/node_modules/hexo-util
> node scripts/build_highlight_alias.js > highlight_alias.json
sh: 1: cannot create highlight_alias.json: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build:highlight: `node scripts/build_highlight_alias.js > highlight_alias.json`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build:highlight script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
原因是什麼呢?我就不多說明了(多看看新聞,關注國家大事,少關什麼注微網誌)
解決辦法一:
你可以使用淘寶定制的 cnpm (gzip 壓縮支援) 指令行工具代替預設的 npm:
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
$ cnpm install [name]
解決辦法二:
npm config set user 0
npm config set unsafe-perm true