Hexo 是一个简单地、轻量地、基于Node的一个静态博客框架。 Hexo Admin Plugin 是可以为Hexo提供后台管理的插件,今天安装了一下hexo-admin的修改版:hexo-admin-qiniu
进入之前安装的blog目录
1 | $ npm install --save hexo-admin-qiniu |
错误提示模块的版本不匹配,可能是因为hexo版本 与很多模块更新不匹配了,尝试删除所有模块,重新安装无果
$ rm -rf node_modules
$ npm install
所以我们重新安装配置下Hexo,解决方法:执行以下代码:
$ npm install hexo --no-optional
$ npm install hexo-cli -g
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/hexo-cli/node_modules/bluebird
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/hexo-cli/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/hexo-cli/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/hexo-cli/node_modules/hexo-fs/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/node_modules/arr-diff/node_modules/arr-flatten
....
npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "hexo-cli" "-g"
npm ERR! node v6.10.1
npm ERR! npm v3.10.10
npm ERR! path /usr/local/lib/node_modules/hexo-cli/node_modules/bluebird
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules/hexo-cli/node_modules/bluebird' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/alex/Projects/blog/npm-debug.log
分析错误由于权限问题,重新执行
$ sudo npm install --unsafe-perm --verbose -g hexo
Password:
....
安装完成,执行启动hexo
$ hexo server -d
INFO Start processing
INFO Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.
启动正常,浏览器访问:http://localhost:4000/admin 现在可以愉快的写博客了