# How to fix this error?

**URL:** <https://forum.codewithmosh.com/t/how-to-fix-this-error/10273>\
**Category:** Node\
**Created:** [January 27, 2022, 10:47am UTC](https://forum.codewithmosh.com/t/how-to-fix-this-error/10273 "2022-01-27T10:47:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pravinkumarosingh](https://avatars.discourse-cdn.com/v4/letter/p/4491bb/32.png) [@pravinkumarosingh](https://forum.codewithmosh.com/u/pravinkumarosingh)\
**Post date:** [January 27, 2022, 10:47am UTC](https://forum.codewithmosh.com/t/how-to-fix-this-error/10273/1 "2022-01-27T10:47:07Z")

</div>

```auto
const parse = require('csv-parse');
const fs = require('fs');

const results = [];

fs.createReadStream('kepler_data.csv')
    .pipe(parse({
        comment: "#",
        columns: true,
    }))
    .on("data", (data) => {
        results.push(data);
    })
    .on("err", (err) => {
        console.log(err)
    })
    .on("end", () => {
        console.log(results)
    });

```

```
.pipe(parse({
      ^

```

TypeError: parse is not a function  
at Object. (C:\Users\pravi\Desktop\node\planets-project\index.js:8:11)  
←[90m at Module.\_compile (node:internal/modules/cjs/loader:1101:14)←[39m  
←[90m at Object.Module.\_extensions…js (node:internal/modules/cjs/loader:1153:10)←[39m  
←[90m at Module.load (node:internal/modules/cjs/loader:981:32)←[39m  
←[90m at Function.Module.\_load (node:internal/modules/cjs/loader:822:12)←[39m  
←[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run\_main:81:12)←[39m  
←[90m at node:internal/main/run\_main\_module:17:47←[39m

---

<div class="post-metadata">

**Author:** ![eelsholz](https://avatars.discourse-cdn.com/v4/letter/e/439d5e/32.png) [@eelsholz](https://forum.codewithmosh.com/u/eelsholz)\
**Post date:** [January 28, 2022, 1:02am UTC](https://forum.codewithmosh.com/t/how-to-fix-this-error/10273/2 "2022-01-28T01:02:09Z")

</div>

```auto
const parse = require('csv-parse').parse;

```

---

<div class="post-metadata">

**Author:** ![pravinkumarosingh](https://avatars.discourse-cdn.com/v4/letter/p/4491bb/32.png) [@pravinkumarosingh](https://forum.codewithmosh.com/u/pravinkumarosingh)\
**Post date:** [January 28, 2022, 6:54am UTC](https://forum.codewithmosh.com/t/how-to-fix-this-error/10273/3 "2022-01-28T06:54:52Z")

</div>

Thanks. It has solve the error.
