javascriptdata / danfojs

Danfo.js is an open source, JavaScript library providing high performance, intuitive, and easy to use data structures for manipulating and processing structured data.
https://danfo.jsdata.org/
MIT License
4.81k stars 209 forks source link

Error building in node.js #388

Closed farzadkhandan closed 2 years ago

farzadkhandan commented 2 years ago

I have added the package to my node.js/typescript application. The package.json file shows "danfojs-node": "^1.0.2".

When I try to build the app using npm run build, I get 139 errors. The first few are:

node_modules/danfojs-node/dist/danfojs-base/shared/types.d.ts:74:5 - error TS1131: Property or signature expected.

74     get dtypes(): Array<string>;
       ~~~

node_modules/danfojs-node/dist/danfojs-base/shared/types.d.ts:74:9 - error TS1005: ';' expected.

74     get dtypes(): Array<string>;
           ~~~~~~

node_modules/danfojs-node/dist/danfojs-base/shared/types.d.ts:74:17 - error TS1005: ';' expected.

74     get dtypes(): Array<string>;
                   ~

node_modules/danfojs-node/dist/danfojs-base/shared/types.d.ts:74:32 - error TS1005: '(' expected.

74     get dtypes(): Array<string>;
                                  ~

node_modules/danfojs-node/dist/danfojs-base/shared/types.d.ts:75:9 - error TS1005: ';' expected.

75     get ndim(): number;
           ~~~~

node_modules/danfojs-node/dist/danfojs-base/shared/types.d.ts:75:15 - error TS1005: ';' expected.

75     get ndim(): number;
                 ~

node_modules/danfojs-node/dist/danfojs-base/shared/types.d.ts:76:9 - error TS1005: ';' expected.

76     get axis(): AxisType;

My build script is

"build:documentation": "copyfiles --flat ./src/documentation/openapi.json ./dist/documentation/",
"build": "tsc && npm run build:documentation"

Any advice? Am I missing something?

farzadkhandan commented 2 years ago

It seems that the compiler is compiling all the *.d.ts again and this creates a problem. Any way to avoid this? setting "skipLibCheck": true in compilerOptions doesn't work though.

farzadkhandan commented 2 years ago

Never mind. I've updated the typescript and node-ts for the local package and it worked!

etothepi16 commented 2 years ago

Never mind. I've updated the typescript and node-ts for the local package and it worked!

Which version of Typescript did you update to? I just got the same issue with "typescript": "^3.8.0" in my package.json

Edit for anyone coming to this issue: as long as you bump typescript to at least version 4 it should work.