0%

hexo建站遇到的问题

用 hexo 建站都能遇到问题啊啊啊啊!!!

hexo init

permission denied-权限不足

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Install dependencies
npm WARN deprecated core-js@1.2.7: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
npm ERR! path /Users/hanhuiyuan/.npm/_cacache/index-v5/0a/25
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/Users/hanhuiyuan/.npm/_cacache/index-v5/0a/25'
npm ERR! [OperationalError: EACCES: permission denied, mkdir '/Users/hanhuiyuan/.npm/_cacache/index-v5/0a/25'] {
npm ERR! cause: [Error: EACCES: permission denied, mkdir '/Users/hanhuiyuan/.npm/_cacache/index-v5/0a/25'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/Users/hanhuiyuan/.npm/_cacache/index-v5/0a/25'
npm ERR! },
npm ERR! isOperational: true,
npm ERR! stack: 'Error: EACCES: permission denied, mkdir ' +
npm ERR! "'/Users/hanhuiyuan/.npm/_cacache/index-v5/0a/25'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/Users/hanhuiyuan/.npm/_cacache/index-v5/0a/25',
npm ERR! parent: 'hexo-server'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/hanhuiyuan/.npm/_logs/2019-06-08T23_36_26_136Z-debug.log
WARN Failed to install dependencies. Please run 'npm install' manually!

处理:

1.sudo hexo init –后面所有命令都要加 sudo,貌似不安全 2.npm install 时出现的 EACCES: permission denied 错误的可能有效的解决方案[https://www.cnblogs.com/zhenqichai/p/npm-eacces-permission-error-fix.html]官网两种解决方法[https://docs.npmjs.com/getting-started/fixing-npm-permissions]_失败_ 3.最后还是使用官方第二种方法,改权限

1
sudo chown -R $USER /usr/local

创建新文章不自带修改时间

方法

进入 themes

next 主题自带该功能
post_meta 中把 update_at 打开就好了

Donate comment here.

欢迎关注我的其它发布渠道