projectMessage.js:35 Uncaught (in promise) TypeError: fs.createReadStream is not a function

有大 佬帮忙解决一下吗
    var FormData = require('form-data');
    var fs = require('fs');
    var data = new FormData();
    data.append('file', fs.createReadStream('/C:/Users/86187/Desktop/双创项目库/测试.txt'));
    return axios({
        url: PROJECT_API_URL + '/project/upload/2',
        method: "POST",
        headers:
        {
            Authorization: 'Bearer ' + token,
            ...data.getHeaders()
        },
        data: data
    })
报错 projectMessage.js:35 Uncaught (in promise) TypeError: fs.createReadStream is not a function

fs.createReadStream 不是一个函数 ,说明 fs 引入错误 或者 api调用错误 。先 打印fs看看 。然后 看看里面有没有createReadStream 方法

你这是前端程序还是服务端程序,前端程序不支持使用nodejs中的fs模块,也就是说fs模块不能再浏览器环境中使用