How to resolve fs.existsSync is not a function

后端 未结 3 1215
借酒劲吻你
借酒劲吻你 2020-12-07 01:31

In NodeJS I have:

const fs = require(\'fs\');
if (!fs.existsSync(\"some_path\")) {
...
}

But I get the error:

TypeEr

3条回答
  •  佛祖请我去吃肉
    2020-12-07 02:05

    I was facing the same Error like TypeError: fs.existsSync is not a function

    So, I figured out that in import there is one extra line added automatically that was creating this issue.

    after removing this line from import

    import { TRUE } from "node-sass";
    

    the issue has been resolved.

提交回复
热议问题