Fork me on GitHub
让一切随风

Martin's Blog


  • 首页

  • 分类

  • 标签

  • 归档

  • 留言

  • 关于

  • 搜索

hexo fs.SyncWriteStream is deprecated

发表于 2018-02-28 | 分类于 hexo

fs.SyncWriteStream is deprecated
出现这个错误需要更新hexo-fs插件

使用
npm install hexo-fs –save

在执行hexo命令的时候,总会显示如下报错:
(node:7048) [DEP0061] DeprecationWarning: fs.SyncWriteStream is deprecated.

从报错信息来看是因为fs.SyncWriteStream is deprecated,node.js从8.0开始已经弃用了fs.SyncWriteStream方法,所以是因为我们node_modules中某个插件调用了这个方法,通过查看Hexo作者GitHub对应的项目,在issue中看到有人提到这个问题,在hexo项目中其中有一个hexo-fs的插件调用了这个方法,所以需要更新hexo-fs插件,更新方法如下:

npm install hexo-fs –save

更新插件后问题依然无法解决。

通过–debug来查看:
[root@server init]# hexo –debug
06:55:32.711 DEBUG Hexo version: 3.5.0
06:55:32.714 DEBUG Working directory: /data/wwwroot/init/
06:55:32.787 DEBUG Config loaded: /data/wwwroot/init/_config.yml
06:55:32.832 DEBUG Plugin loaded: hexo-admin
(node:25414) [DEP0061] DeprecationWarning: fs.SyncWriteStream is deprecated.

问题出在:hexo-admin的hexo-fs
因hexo-admin作为后台管理,无法npm uninstall hexo-admin卸载,则找到对应文件,注释:

[root@server init]# grep -irn “SyncWriteStream” ./node_modules/hexo-admin/
./node_modules/hexo-admin/node_modules/hexo-fs/lib/fs.js:718:exports.SyncWriteStream = fs.SyncWriteStream;
[root@lywserver init]#

将对应的exports.SyncWriteStream = fs.SyncWriteStream;注释(前面 //)即可!

ELK x-pack 详细说明

发表于 2018-02-26 | 分类于 ELK

我还能说什么呢??

Hello World

发表于 2018-02-22

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

123
Martin Lei

Martin Lei

Still Waters Run Deep

23 日志
6 分类
8 标签
RSS
GitHub E-Mail Twitter 微博
友情链接
  • 老缪
  • jimmysong
  • github
© 2019 Martin Lei  粤ICP备18019482号-1 本站总访问量 次, 访客数 人次, 本文总阅读量 次