如何避免“在严格模式下不允许使用总计文字";与createWriteStream [英] how to avoid "Octal literals are not allowed in strict mode" with createWriteStream

查看:106
本文介绍了如何避免“在严格模式下不允许使用总计文字";与createWriteStream的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码

 fs.createWriteStream( fileName, {
        flags    : 'a',
        encoding : 'utf8',
        mode     : 0644
    });

我收到一个皮棉错误

Octal literals are not allowed in strict mode.

执行此代码的正确方法是什么,这样我就不会出现皮棉错误?

What is the correct way to do this code so I won't get a lint error?

推荐答案

我手头没有节点安装,但查看

I don't have a node installation at hand, but looking at sources it seems that they allow strings as well:

  mode     : '0644'

行得通吗?

这篇关于如何避免“在严格模式下不允许使用总计文字";与createWriteStream的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆